| 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 GetHealthEventRequest extends Omit< |
| 7 | im.GetHealthEventInput, |
| 8 | "MonitorName" |
| 9 | > {} |
| 10 | |
| 11 | /** |
| 12 | * Runtime binding for `internetmonitor:GetHealthEvent` — read the full |
| 13 | * detail (impacted locations, availability/performance measurements, impact |
| 14 | * type) of one health event on the bound {@link Monitor}; the monitor name |
| 15 | * is injected automatically. |
| 16 | * |
| 17 | * Provide `InternetMonitor.GetHealthEventHttp` on the hosting Lambda |
| 18 | * Function to satisfy the requirement. |
| 19 | * ### Reading Health Events |
| 20 | * **Example:** Read a Health Event by Id |
| 21 | * ```typescript |
| 22 | * // init — grants internetmonitor:GetHealthEvent on the monitor |
| 23 | * const getHealthEvent = yield* AWS.InternetMonitor.GetHealthEvent(monitor); |
| 24 | * |
| 25 | * // runtime |
| 26 | * const event = yield* getHealthEvent({ EventId: eventId }); |
| 27 | * const locations = event.ImpactedLocations; |
| 28 | * ``` |
| 29 | * |
| 30 | * @binding |
| 31 | */ |
| 32 | export interface GetHealthEvent extends Binding.Service< |
| 33 | GetHealthEvent, |
| 34 | "AWS.InternetMonitor.GetHealthEvent", |
| 35 | ( |
| 36 | monitor: Monitor, |
| 37 | ) => Effect.Effect< |
| 38 | ( |
| 39 | request: GetHealthEventRequest, |
| 40 | ) => Effect.Effect<im.GetHealthEventOutput, im.GetHealthEventError> |
| 41 | > |
| 42 | > {} |
| 43 | |
| 44 | export const GetHealthEvent = Binding.Service<GetHealthEvent>( |
| 45 | "AWS.InternetMonitor.GetHealthEvent", |
| 46 | ); |