| 1 | import type * as appsignals from "@distilled.cloud/aws/application-signals"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { ServiceLevelObjective } from "./ServiceLevelObjective.ts"; |
| 5 | |
| 6 | /** |
| 7 | * `BatchUpdateExclusionWindows` request with `SloIds` injected from the |
| 8 | * bound {@link ServiceLevelObjective}. |
| 9 | */ |
| 10 | export interface UpdateExclusionWindowsRequest extends Omit< |
| 11 | appsignals.BatchUpdateExclusionWindowsInput, |
| 12 | "SloIds" |
| 13 | > {} |
| 14 | |
| 15 | /** |
| 16 | * Runtime binding for `application-signals:BatchUpdateExclusionWindows`, |
| 17 | * scoped to one {@link ServiceLevelObjective}. |
| 18 | * |
| 19 | * Adds or removes exclusion (maintenance) windows on the bound SLO — for |
| 20 | * example, automation that excludes a deployment window from SLO |
| 21 | * attainment. Provide the implementation with |
| 22 | * `Effect.provide(AWS.ApplicationSignals.BatchUpdateExclusionWindowsHttp)`. |
| 23 | * ### Managing Exclusion Windows |
| 24 | * **Example:** Exclude a Maintenance Window |
| 25 | * ```typescript |
| 26 | * // init — bind the operation to the SLO |
| 27 | * const updateExclusionWindows = |
| 28 | * yield* AWS.ApplicationSignals.BatchUpdateExclusionWindows(slo); |
| 29 | * |
| 30 | * // runtime — the SLO's ARN is injected as SloIds |
| 31 | * yield* updateExclusionWindows({ |
| 32 | * AddExclusionWindows: [ |
| 33 | * { |
| 34 | * StartTime: new Date(), |
| 35 | * Window: { DurationUnit: "HOUR", Duration: 2 }, |
| 36 | * Reason: "scheduled maintenance", |
| 37 | * }, |
| 38 | * ], |
| 39 | * }); |
| 40 | * ``` |
| 41 | * |
| 42 | * @binding |
| 43 | */ |
| 44 | export interface BatchUpdateExclusionWindows extends Binding.Service< |
| 45 | BatchUpdateExclusionWindows, |
| 46 | "AWS.ApplicationSignals.BatchUpdateExclusionWindows", |
| 47 | ( |
| 48 | slo: ServiceLevelObjective, |
| 49 | ) => Effect.Effect< |
| 50 | ( |
| 51 | request: UpdateExclusionWindowsRequest, |
| 52 | ) => Effect.Effect< |
| 53 | appsignals.BatchUpdateExclusionWindowsOutput, |
| 54 | appsignals.BatchUpdateExclusionWindowsError |
| 55 | > |
| 56 | > |
| 57 | > {} |
| 58 | |
| 59 | export const BatchUpdateExclusionWindows = |
| 60 | Binding.Service<BatchUpdateExclusionWindows>( |
| 61 | "AWS.ApplicationSignals.BatchUpdateExclusionWindows", |
| 62 | ); |