@devries-cameron20 / t3code Mirror · read-only
Fork 0

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

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 06:00 UTC

main
ts 46 lines 1.44 KB
Raw
1 import * as cloudwatch from "@distilled.cloud/aws/cloudwatch";
2 import * as Binding from "alchemy/Binding";
3 import * as Effect from "effect/Effect";
4
5 export interface DescribeAlarmsForMetricRequest extends cloudwatch.DescribeAlarmsForMetricInput {}
6
7 /**
8 * Runtime binding for `cloudwatch:DescribeAlarmsForMetric` — find the
9 * alarms watching a specific metric.
10 *
11 * Provide `CloudWatch.DescribeAlarmsForMetricHttp` on the hosting Lambda
12 * Function to satisfy the requirement.
13 * ### Reading Alarm State
14 * **Example:** Find Alarms Watching a Metric
15 * ```typescript
16 * // init — grants cloudwatch:DescribeAlarmsForMetric
17 * const describeAlarmsForMetric = yield* AWS.CloudWatch.DescribeAlarmsForMetric();
18 *
19 * // runtime
20 * const result = yield* describeAlarmsForMetric({
21 * Namespace: "MyApp/Payments",
22 * MetricName: "PaymentProcessed",
23 * Statistic: "Sum",
24 * Period: 60,
25 * });
26 * const alarmNames = (result.MetricAlarms ?? []).map((a) => a.AlarmName);
27 * ```
28 *
29 * @binding
30 */
31 export interface DescribeAlarmsForMetric extends Binding.Service<
32 DescribeAlarmsForMetric,
33 "AWS.CloudWatch.DescribeAlarmsForMetric",
34 () => Effect.Effect<
35 (
36 request: DescribeAlarmsForMetricRequest,
37 ) => Effect.Effect<
38 cloudwatch.DescribeAlarmsForMetricOutput,
39 cloudwatch.DescribeAlarmsForMetricError
40 >
41 >
42 > {}
43
44 export const DescribeAlarmsForMetric = Binding.Service<DescribeAlarmsForMetric>(
45 "AWS.CloudWatch.DescribeAlarmsForMetric",
46 );