| 1 | import * as im from "@distilled.cloud/aws/internetmonitor"; |
| 2 | import * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Monitor } from "./Monitor.ts"; |
| 5 | |
| 6 | export 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 | */ |
| 30 | export 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 | |
| 42 | export const GetQueryResults = Binding.Service<GetQueryResults>( |
| 43 | "AWS.InternetMonitor.GetQueryResults", |
| 44 | ); |