| 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:GetQueryResults`. |
| 8 | * |
| 9 | * Reads one page of a finished CloudTrail Lake query's result rows — use |
| 10 | * `NextToken`/`MaxQueryResults` to paginate large results. Provide the |
| 11 | * implementation with `Effect.provide(AWS.CloudTrail.GetQueryResultsHttp)`. |
| 12 | * ### Querying CloudTrail Lake |
| 13 | * **Example:** Read Query Results |
| 14 | * ```typescript |
| 15 | * // init — bind the operation to the event data store |
| 16 | * const getQueryResults = yield* AWS.CloudTrail.GetQueryResults(store); |
| 17 | * |
| 18 | * // runtime |
| 19 | * const page = yield* getQueryResults({ QueryId: queryId }); |
| 20 | * console.log(page.QueryResultRows?.length); |
| 21 | * ``` |
| 22 | * |
| 23 | * @binding |
| 24 | */ |
| 25 | export interface GetQueryResults extends Binding.Service< |
| 26 | GetQueryResults, |
| 27 | "AWS.CloudTrail.GetQueryResults", |
| 28 | ( |
| 29 | store: EventDataStore, |
| 30 | ) => Effect.Effect< |
| 31 | ( |
| 32 | request: Omit<cloudtrail.GetQueryResultsRequest, "EventDataStore">, |
| 33 | ) => Effect.Effect< |
| 34 | cloudtrail.GetQueryResultsResponse, |
| 35 | cloudtrail.GetQueryResultsError |
| 36 | > |
| 37 | > |
| 38 | > {} |
| 39 | export const GetQueryResults = Binding.Service<GetQueryResults>( |
| 40 | "AWS.CloudTrail.GetQueryResults", |
| 41 | ); |