| 1 | import type * as ssm from "@distilled.cloud/aws/ssm-contacts"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Rotation } from "./Rotation.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for `ssm-contacts:CreateRotationOverride`. |
| 8 | * |
| 9 | * Temporarily override who is on call in the bound rotation — e.g. cover |
| 10 | * a shift while the scheduled contact is unavailable. The rotation's ARN |
| 11 | * is injected as `RotationId`. |
| 12 | * Provide the implementation with |
| 13 | * `Effect.provide(AWS.SSMContacts.CreateRotationOverrideHttp)`. |
| 14 | * ### Managing On-Call Rotations |
| 15 | * **Example:** Cover the Next Eight Hours |
| 16 | * ```typescript |
| 17 | * const createRotationOverride = |
| 18 | * yield* AWS.SSMContacts.CreateRotationOverride(rotation); |
| 19 | * |
| 20 | * const { RotationOverrideId } = yield* createRotationOverride({ |
| 21 | * NewContactIds: [standbyContactArn], |
| 22 | * StartTime: new Date(), |
| 23 | * EndTime: new Date(Date.now() + 8 * 60 * 60 * 1000), |
| 24 | * }); |
| 25 | * ``` |
| 26 | * |
| 27 | * @binding |
| 28 | */ |
| 29 | export interface CreateRotationOverride extends Binding.Service< |
| 30 | CreateRotationOverride, |
| 31 | "AWS.SSMContacts.CreateRotationOverride", |
| 32 | ( |
| 33 | rotation: Rotation, |
| 34 | ) => Effect.Effect< |
| 35 | ( |
| 36 | request: Omit<ssm.CreateRotationOverrideRequest, "RotationId">, |
| 37 | ) => Effect.Effect< |
| 38 | ssm.CreateRotationOverrideResult, |
| 39 | ssm.CreateRotationOverrideError |
| 40 | > |
| 41 | > |
| 42 | > {} |
| 43 | export const CreateRotationOverride = Binding.Service<CreateRotationOverride>( |
| 44 | "AWS.SSMContacts.CreateRotationOverride", |
| 45 | ); |