1import type * as ssm from "@distilled.cloud/aws/ssm-contacts";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { Contact } from "./Contact.ts";
5
6/**
7 * Runtime binding for `ssm-contacts:StartEngagement`.
8 *
9 * Page the bound contact (or run its escalation plan) — Incident Manager
10 * works through the contact's engagement plan, sending the subject and
11 * content over each stage's channels until the page is acknowledged. The
12 * contact's ARN is injected as `ContactId`.
13 * Provide the implementation with
14 * `Effect.provide(AWS.SSMContacts.StartEngagementHttp)`.
15 * ### Starting Engagements
16 * **Example:** Page the On-Call Contact
17 * ```typescript
18 * // init — bind the operation to the contact
19 * const startEngagement = yield* AWS.SSMContacts.StartEngagement(oncall);
20 *
21 * // runtime — page the contact when an alert fires
22 * const { EngagementArn } = yield* startEngagement({
23 * Sender: "alert-bot",
24 * Subject: "Database CPU at 95%",
25 * Content: "Primary DB is saturated - please investigate.",
26 * });
27 * ```
28 *
29 * @binding
30 */
31export interface StartEngagement extends Binding.Service<
32 StartEngagement,
33 "AWS.SSMContacts.StartEngagement",
34 (
35 contact: Contact,
36 ) => Effect.Effect<
37 (
38 request: Omit<ssm.StartEngagementRequest, "ContactId">,
39 ) => Effect.Effect<ssm.StartEngagementResult, ssm.StartEngagementError>
40 >
41> {}
42export const StartEngagement = Binding.Service<StartEngagement>(
43 "AWS.SSMContacts.StartEngagement",
44);