| 1 | import * as im from "@distilled.cloud/aws/internetmonitor"; |
| 2 | import * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Monitor } from "./Monitor.ts"; |
| 5 | |
| 6 | export interface ListHealthEventsRequest extends Omit< |
| 7 | im.ListHealthEventsInput, |
| 8 | "MonitorName" |
| 9 | > {} |
| 10 | |
| 11 | /** |
| 12 | * Runtime binding for `internetmonitor:ListHealthEvents` — list the health |
| 13 | * events Internet Monitor created for the bound {@link Monitor}; the monitor |
| 14 | * name is injected automatically. |
| 15 | * |
| 16 | * Provide `InternetMonitor.ListHealthEventsHttp` on the hosting Lambda |
| 17 | * Function to satisfy the requirement. |
| 18 | * ### Reading Health Events |
| 19 | * **Example:** List Active Health Events |
| 20 | * ```typescript |
| 21 | * // init — grants internetmonitor:ListHealthEvents on the monitor |
| 22 | * const listHealthEvents = yield* AWS.InternetMonitor.ListHealthEvents(monitor); |
| 23 | * |
| 24 | * // runtime |
| 25 | * const { HealthEvents } = yield* listHealthEvents({ EventStatus: "ACTIVE" }); |
| 26 | * ``` |
| 27 | * |
| 28 | * @binding |
| 29 | */ |
| 30 | export interface ListHealthEvents extends Binding.Service< |
| 31 | ListHealthEvents, |
| 32 | "AWS.InternetMonitor.ListHealthEvents", |
| 33 | ( |
| 34 | monitor: Monitor, |
| 35 | ) => Effect.Effect< |
| 36 | ( |
| 37 | request?: ListHealthEventsRequest, |
| 38 | ) => Effect.Effect<im.ListHealthEventsOutput, im.ListHealthEventsError> |
| 39 | > |
| 40 | > {} |
| 41 | |
| 42 | export const ListHealthEvents = Binding.Service<ListHealthEvents>( |
| 43 | "AWS.InternetMonitor.ListHealthEvents", |
| 44 | ); |