1import * as im from "@distilled.cloud/aws/internetmonitor";
2import * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { Monitor } from "./Monitor.ts";
5
6export interface GetQueryResultsRequest extends Omit<
7 im.GetQueryResultsInput,
8 "MonitorName"
9> {}
10
11/**
12 * Runtime binding for `internetmonitor:GetQueryResults` — fetch the result
13 * rows of a `SUCCEEDED` query on the bound {@link Monitor}; the monitor name
14 * is injected automatically.
15 *
16 * Provide `InternetMonitor.GetQueryResultsHttp` on the hosting Lambda
17 * Function to satisfy the requirement.
18 * ### Querying Measurements
19 * **Example:** Read Query Results
20 * ```typescript
21 * // init — grants internetmonitor:GetQueryResults on the monitor
22 * const getQueryResults = yield* AWS.InternetMonitor.GetQueryResults(monitor);
23 *
24 * // runtime
25 * const { Fields, Data } = yield* getQueryResults({ QueryId: queryId });
26 * ```
27 *
28 * @binding
29 */
30export interface GetQueryResults extends Binding.Service<
31 GetQueryResults,
32 "AWS.InternetMonitor.GetQueryResults",
33 (
34 monitor: Monitor,
35 ) => Effect.Effect<
36 (
37 request: GetQueryResultsRequest,
38 ) => Effect.Effect<im.GetQueryResultsOutput, im.GetQueryResultsError>
39 >
40> {}
41
42export const GetQueryResults = Binding.Service<GetQueryResults>(
43 "AWS.InternetMonitor.GetQueryResults",
44);