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

main
ts 40 lines 1.35 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 { MetricStream } from "./MetricStream.ts";
5
6 export interface GetMetricStreamRequest extends Omit<cloudwatch.GetMetricStreamInput, "Name"> {}
7
8 /**
9 * Runtime binding for `cloudwatch:GetMetricStream` — read the
10 * configuration and state of the bound {@link MetricStream}; the stream
11 * name is injected automatically.
12 *
13 * Provide `CloudWatch.GetMetricStreamHttp` on the hosting Lambda Function
14 * to satisfy the requirement.
15 * ### Reading Metric Streams
16 * **Example:** Read a Bound Metric Stream
17 * ```typescript
18 * // init — grants cloudwatch:GetMetricStream on the stream
19 * const getMetricStream = yield* AWS.CloudWatch.GetMetricStream(metricStream);
20 *
21 * // runtime
22 * const result = yield* getMetricStream();
23 * const state = result.State; // "running" | "stopped"
24 * ```
25 *
26 * @binding
27 */
28 export interface GetMetricStream extends Binding.Service<
29 GetMetricStream,
30 "AWS.CloudWatch.GetMetricStream",
31 (
32 metricStream: MetricStream,
33 ) => Effect.Effect<
34 (
35 request?: GetMetricStreamRequest,
36 ) => Effect.Effect<cloudwatch.GetMetricStreamOutput, cloudwatch.GetMetricStreamError>
37 >
38 > {}
39
40 export const GetMetricStream = Binding.Service<GetMetricStream>("AWS.CloudWatch.GetMetricStream");