| 1 | import type * as ce from "@distilled.cloud/aws/cost-explorer"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { AnomalyMonitor } from "./AnomalyMonitor.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Request for {@link GetAnomalies} — the bound monitor's ARN is |
| 8 | * injected automatically. |
| 9 | */ |
| 10 | export interface GetAnomaliesRequest extends Omit< |
| 11 | ce.GetAnomaliesRequest, |
| 12 | "MonitorArn" |
| 13 | > {} |
| 14 | |
| 15 | /** |
| 16 | * Runtime binding for `ce:GetAnomalies`. |
| 17 | * |
| 18 | * Retrieve the cost anomalies a monitor detected during a date |
| 19 | * interval (available for up to 90 days). Provide the implementation with |
| 20 | * `Effect.provide(AWS.CostExplorer.GetAnomaliesHttp)`. |
| 21 | * ### Anomaly Detection at Runtime |
| 22 | * **Example:** List a Monitor's Anomalies |
| 23 | * ```typescript |
| 24 | * // init — bind the operation to the monitor |
| 25 | * const getAnomalies = yield* AWS.CostExplorer.GetAnomalies(monitor); |
| 26 | * |
| 27 | * // runtime |
| 28 | * const result = yield* getAnomalies({ |
| 29 | * DateInterval: { StartDate: "2026-06-01" }, |
| 30 | * }); |
| 31 | * const anomalies = result.Anomalies; |
| 32 | * ``` |
| 33 | * |
| 34 | * @binding |
| 35 | */ |
| 36 | export interface GetAnomalies extends Binding.Service< |
| 37 | GetAnomalies, |
| 38 | "AWS.CostExplorer.GetAnomalies", |
| 39 | ( |
| 40 | monitor: AnomalyMonitor, |
| 41 | ) => Effect.Effect< |
| 42 | ( |
| 43 | request: GetAnomaliesRequest, |
| 44 | ) => Effect.Effect<ce.GetAnomaliesResponse, ce.GetAnomaliesError> |
| 45 | > |
| 46 | > {} |
| 47 | |
| 48 | export const GetAnomalies = Binding.Service<GetAnomalies>( |
| 49 | "AWS.CostExplorer.GetAnomalies", |
| 50 | ); |