@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 56 lines 1.84 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 import type { AlarmResource } from "./binding-common.ts";
5
6 export interface DescribeAlarmContributorsRequest extends Omit<
7 cloudwatch.DescribeAlarmContributorsInput,
8 "AlarmName"
9 > {}
10
11 /**
12 * Runtime binding for `cloudwatch:DescribeAlarmContributors` — list the
13 * time-series contributors currently in ALARM for a contributor-enabled
14 * metric-math alarm. Bind it to the {@link Alarm}; the alarm name is
15 * injected automatically.
16 *
17 * Provide `CloudWatch.DescribeAlarmContributorsHttp` on the hosting Lambda
18 * Function to satisfy the requirement.
19 * ### Reading Alarm State
20 * **Example:** List an Alarm's Contributors
21 * ```typescript
22 * // init — grants cloudwatch:DescribeAlarmContributors on the alarm
23 * const describeAlarmContributors =
24 * yield* AWS.CloudWatch.DescribeAlarmContributors(alarm);
25 *
26 * // runtime — plain metric alarms have no contributor data; the typed
27 * // errors let you treat that as an empty result
28 * const contributors = yield* describeAlarmContributors().pipe(
29 * Effect.map((r) => r.AlarmContributors ?? []),
30 * Effect.catchTag(
31 * ["ResourceNotFoundException", "ValidationException"],
32 * () => Effect.succeed([]),
33 * ),
34 * );
35 * ```
36 *
37 * @binding
38 */
39 export interface DescribeAlarmContributors extends Binding.Service<
40 DescribeAlarmContributors,
41 "AWS.CloudWatch.DescribeAlarmContributors",
42 (
43 alarm: AlarmResource,
44 ) => Effect.Effect<
45 (
46 request?: DescribeAlarmContributorsRequest,
47 ) => Effect.Effect<
48 cloudwatch.DescribeAlarmContributorsOutput,
49 cloudwatch.DescribeAlarmContributorsError
50 >
51 >
52 > {}
53
54 export const DescribeAlarmContributors = Binding.Service<DescribeAlarmContributors>(
55 "AWS.CloudWatch.DescribeAlarmContributors",
56 );