1import type * as incidents from "@distilled.cloud/aws/ssm-incidents";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { ResponsePlan } from "./ResponsePlan.ts";
5
6/**
7 * Runtime binding for `ssm-incidents:StartIncident`.
8 *
9 * Starts an incident from the bound {@link ResponsePlan} — Incident Manager
10 * creates the incident record, engages the plan's contacts, posts to its
11 * chat channel, and runs its Automation runbooks. The response plan ARN is
12 * injected from the binding; pass `triggerDetails` to record what fired the
13 * incident.
14 * Provide the implementation with
15 * `Effect.provide(AWS.SSMIncidents.StartIncidentHttp)`.
16 * ### Starting Incidents
17 * **Example:** Open An Incident From An Alarm Handler
18 * ```typescript
19 * // init — bind the operation to the response plan
20 * const startIncident = yield* AWS.SSMIncidents.StartIncident(plan);
21 *
22 * // runtime
23 * const { incidentRecordArn } = yield* startIncident({
24 * title: "checkout p99 breach",
25 * impact: 2,
26 * triggerDetails: {
27 * source: "custom.checkout-monitor",
28 * timestamp: new Date(),
29 * },
30 * });
31 * ```
32 *
33 * @binding
34 */
35export interface StartIncident extends Binding.Service<
36 StartIncident,
37 "AWS.SSMIncidents.StartIncident",
38 (
39 plan: ResponsePlan,
40 ) => Effect.Effect<
41 (
42 request?: Omit<incidents.StartIncidentInput, "responsePlanArn">,
43 ) => Effect.Effect<
44 incidents.StartIncidentOutput,
45 incidents.StartIncidentError
46 >
47 >
48> {}
49export const StartIncident = Binding.Service<StartIncident>(
50 "AWS.SSMIncidents.StartIncident",
51);