The best way to control Claude Code, Codex and more from any computer or phone

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