1import type * as TSQ from "@distilled.cloud/aws/timestream-query";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4
5export interface CancelQueryRequest extends TSQ.CancelQueryRequest {}
6
7/**
8 * Runtime binding for `timestream-query:CancelQuery` — cancel a running query
9 * by the `QueryId` a previous `Query` call reported.
10 *
11 * `timestream:CancelQuery` does not support resource-level permissions, so
12 * this is an account-level binding invoked with no resource argument.
13 *
14 * Provide `Timestream.CancelQueryHttp` on the Function to implement the
15 * binding.
16 *
17 * ### Querying Data
18 * **Example:** Cancel a running query
19 * ```typescript
20 * // init — account-level binding, no resource argument
21 * const cancelQuery = yield* Timestream.CancelQuery();
22 *
23 * // runtime — cancel by the QueryId from a prior Query response
24 * const result = yield* cancelQuery({ QueryId: queryId });
25 * // result.CancellationMessage reports whether the query was still running
26 * ```
27 *
28 * @binding
29 */
30export interface CancelQuery extends Binding.Service<
31 CancelQuery,
32 "AWS.Timestream.CancelQuery",
33 () => Effect.Effect<
34 (
35 request: CancelQueryRequest,
36 ) => Effect.Effect<
37 TSQ.CancelQueryResponse,
38 TSQ.CancelQueryError | TSQ.DescribeEndpointsError
39 >
40 >
41> {}
42
43export const CancelQuery = Binding.Service<CancelQuery>(
44 "AWS.Timestream.CancelQuery",
45);