| 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 | |
| 5 | /** |
| 6 | * Runtime binding for `cloudtrail:ListInsightsData`. |
| 7 | * |
| 8 | * An account-level operation (no resource argument) that reads the raw |
| 9 | * Insights events recorded for an insight source — empty when Insights has |
| 10 | * recorded no anomalies. Rate-limited by AWS to two requests per second, |
| 11 | * per account, per Region. Provide the implementation with |
| 12 | * `Effect.provide(AWS.CloudTrail.ListInsightsDataHttp)`. |
| 13 | * ### Reading Insights Events |
| 14 | * **Example:** List Insights Events |
| 15 | * ```typescript |
| 16 | * // init — account-level binding takes no resource |
| 17 | * const listInsightsData = yield* AWS.CloudTrail.ListInsightsData(); |
| 18 | * |
| 19 | * // runtime |
| 20 | * const result = yield* listInsightsData({ |
| 21 | * InsightSource: "s3.amazonaws.com", |
| 22 | * DataType: "InsightsEvents", |
| 23 | * MaxResults: 10, |
| 24 | * }); |
| 25 | * console.log((result.Events ?? []).map((e) => e.EventName)); |
| 26 | * ``` |
| 27 | * |
| 28 | * @binding |
| 29 | */ |
| 30 | export interface ListInsightsData extends Binding.Service< |
| 31 | ListInsightsData, |
| 32 | "AWS.CloudTrail.ListInsightsData", |
| 33 | () => Effect.Effect< |
| 34 | ( |
| 35 | request: cloudtrail.ListInsightsDataRequest, |
| 36 | ) => Effect.Effect< |
| 37 | cloudtrail.ListInsightsDataResponse, |
| 38 | cloudtrail.ListInsightsDataError |
| 39 | > |
| 40 | > |
| 41 | > {} |
| 42 | export const ListInsightsData = Binding.Service<ListInsightsData>( |
| 43 | "AWS.CloudTrail.ListInsightsData", |
| 44 | ); |