TypeScript
import * as im from "@distilled.cloud/aws/internetmonitor";
import * as Binding from "alchemy/Binding";
import * as Effect from "effect/Effect";
import type { Monitor } from "./Monitor.ts";
export interface ListHealthEventsRequest extends Omit<im.ListHealthEventsInput, "MonitorName"> {}
/**
* Runtime binding for `internetmonitor:ListHealthEvents` — list the health
* events Internet Monitor created for the bound {@link Monitor}; the monitor
* name is injected automatically.
*
* Provide `InternetMonitor.ListHealthEventsHttp` on the hosting Lambda
* Function to satisfy the requirement.
* ### Reading Health Events
* **Example:** List Active Health Events
* ```typescript
* // init — grants internetmonitor:ListHealthEvents on the monitor
* const listHealthEvents = yield* AWS.InternetMonitor.ListHealthEvents(monitor);
*
* // runtime
* const { HealthEvents } = yield* listHealthEvents({ EventStatus: "ACTIVE" });
* ```
*
* @binding
*/
export interface ListHealthEvents extends Binding.Service<
ListHealthEvents,
"AWS.InternetMonitor.ListHealthEvents",
(
monitor: Monitor,
) => Effect.Effect<
(
request?: ListHealthEventsRequest,
) => Effect.Effect<im.ListHealthEventsOutput, im.ListHealthEventsError>
>
> {}
export const ListHealthEvents = Binding.Service<ListHealthEvents>(
"AWS.InternetMonitor.ListHealthEvents",
);