| 1 | import type * as cloudtrail from "@distilled.cloud/aws/cloudtrail"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { EventDataStore } from "./EventDataStore.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for `cloudtrail:DescribeQuery`. |
| 8 | * |
| 9 | * Reads a CloudTrail Lake query's status, statistics, and error message by |
| 10 | * `QueryId` — the polling half of the start/poll/results flow. Provide the |
| 11 | * implementation with `Effect.provide(AWS.CloudTrail.DescribeQueryHttp)`. |
| 12 | * ### Querying CloudTrail Lake |
| 13 | * **Example:** Poll a Query to Completion |
| 14 | * ```typescript |
| 15 | * // init — bind the operation to the event data store |
| 16 | * const describeQuery = yield* AWS.CloudTrail.DescribeQuery(store); |
| 17 | * |
| 18 | * // runtime |
| 19 | * const status = yield* describeQuery({ QueryId: queryId }); |
| 20 | * console.log(status.QueryStatus); // QUEUED | RUNNING | FINISHED | ... |
| 21 | * ``` |
| 22 | * |
| 23 | * @binding |
| 24 | */ |
| 25 | export interface DescribeQuery extends Binding.Service< |
| 26 | DescribeQuery, |
| 27 | "AWS.CloudTrail.DescribeQuery", |
| 28 | ( |
| 29 | store: EventDataStore, |
| 30 | ) => Effect.Effect< |
| 31 | ( |
| 32 | request: Omit<cloudtrail.DescribeQueryRequest, "EventDataStore">, |
| 33 | ) => Effect.Effect< |
| 34 | cloudtrail.DescribeQueryResponse, |
| 35 | cloudtrail.DescribeQueryError |
| 36 | > |
| 37 | > |
| 38 | > {} |
| 39 | export const DescribeQuery = Binding.Service<DescribeQuery>( |
| 40 | "AWS.CloudTrail.DescribeQuery", |
| 41 | ); |