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

main
ts 41 lines 1.34 KB
Raw
1 import * as im from "@distilled.cloud/aws/internetmonitor";
2 import * as Binding from "alchemy/Binding";
3 import * as Effect from "effect/Effect";
4 import type { Monitor } from "./Monitor.ts";
5
6 export interface StartQueryRequest extends Omit<im.StartQueryInput, "MonitorName"> {}
7
8 /**
9 * Runtime binding for `internetmonitor:StartQuery` — start a query against
10 * the bound {@link Monitor}'s measurement data with the Internet Monitor
11 * query interface; the monitor name is injected automatically.
12 *
13 * Provide `InternetMonitor.StartQueryHttp` on the hosting Lambda Function to
14 * satisfy the requirement.
15 * ### Querying Measurements
16 * **Example:** Start a Measurements Query
17 * ```typescript
18 * // init — grants internetmonitor:StartQuery on the monitor
19 * const startQuery = yield* AWS.InternetMonitor.StartQuery(monitor);
20 *
21 * // runtime
22 * const { QueryId } = yield* startQuery({
23 * StartTime: new Date(Date.now() - 3_600_000),
24 * EndTime: new Date(),
25 * QueryType: "MEASUREMENTS",
26 * });
27 * ```
28 *
29 * @binding
30 */
31 export interface StartQuery extends Binding.Service<
32 StartQuery,
33 "AWS.InternetMonitor.StartQuery",
34 (
35 monitor: Monitor,
36 ) => Effect.Effect<
37 (request: StartQueryRequest) => Effect.Effect<im.StartQueryOutput, im.StartQueryError>
38 >
39 > {}
40
41 export const StartQuery = Binding.Service<StartQuery>("AWS.InternetMonitor.StartQuery");