| 1 | import type * as xray from "@distilled.cloud/aws/xray"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | |
| 5 | export interface GetInsightSummariesRequest |
| 6 | extends xray.GetInsightSummariesRequest {} |
| 7 | |
| 8 | /** |
| 9 | * Retrieve the summaries of all insights in a group (by name or ARN) |
| 10 | * matching the provided state and time filters. |
| 11 | * |
| 12 | * Bind the operation in the function's init phase to get a runtime callable; |
| 13 | * provide the implementation with `Effect.provide(XRay.GetInsightSummariesHttp)`. |
| 14 | * The action is account-scoped: X-Ray does not support resource-level |
| 15 | * permissions for `xray:GetInsightSummaries`, so the binding grants it on `*`. |
| 16 | * ### Insights |
| 17 | * **Example:** List recent insights for a group |
| 18 | * ```typescript |
| 19 | * import * as XRay from "alchemy/AWS/XRay"; |
| 20 | * |
| 21 | * // init — grants xray:GetInsightSummaries |
| 22 | * const getInsightSummaries = yield* XRay.GetInsightSummaries(); |
| 23 | * |
| 24 | * // runtime |
| 25 | * const now = yield* Effect.sync(() => Date.now()); |
| 26 | * const result = yield* getInsightSummaries({ |
| 27 | * GroupName: group.groupName, |
| 28 | * StartTime: new Date(now - 24 * 60 * 60 * 1000), |
| 29 | * EndTime: new Date(now), |
| 30 | * }); |
| 31 | * const insights = result.InsightSummaries ?? []; |
| 32 | * ``` |
| 33 | * |
| 34 | * @binding |
| 35 | */ |
| 36 | export interface GetInsightSummaries extends Binding.Service< |
| 37 | GetInsightSummaries, |
| 38 | "AWS.XRay.GetInsightSummaries", |
| 39 | () => Effect.Effect< |
| 40 | ( |
| 41 | request: GetInsightSummariesRequest, |
| 42 | ) => Effect.Effect< |
| 43 | xray.GetInsightSummariesResult, |
| 44 | xray.GetInsightSummariesError |
| 45 | > |
| 46 | > |
| 47 | > {} |
| 48 | export const GetInsightSummaries = Binding.Service<GetInsightSummaries>( |
| 49 | "AWS.XRay.GetInsightSummaries", |
| 50 | ); |