1import type * as xray from "@distilled.cloud/aws/xray";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4
5export interface GetInsightEventsRequest extends xray.GetInsightEventsRequest {}
6
7/**
8 * Retrieve the intermediate states (events) X-Ray recorded while
9 * re-evaluating an insight — the insight's impact timeline.
10 *
11 * Bind the operation in the function's init phase to get a runtime callable;
12 * provide the implementation with `Effect.provide(XRay.GetInsightEventsHttp)`.
13 * The action is account-scoped: X-Ray does not support resource-level
14 * permissions for `xray:GetInsightEvents`, so the binding grants it on `*`.
15 * ### Insights
16 * **Example:** Walk an insight's impact timeline
17 * ```typescript
18 * import * as XRay from "alchemy/AWS/XRay";
19 *
20 * // init — grants xray:GetInsightEvents
21 * const getInsightEvents = yield* XRay.GetInsightEvents();
22 *
23 * // runtime
24 * const result = yield* getInsightEvents({ InsightId: insightId });
25 * const timeline = result.InsightEvents ?? [];
26 * ```
27 *
28 * @binding
29 */
30export interface GetInsightEvents extends Binding.Service<
31 GetInsightEvents,
32 "AWS.XRay.GetInsightEvents",
33 () => Effect.Effect<
34 (
35 request: GetInsightEventsRequest,
36 ) => Effect.Effect<xray.GetInsightEventsResult, xray.GetInsightEventsError>
37 >
38> {}
39export const GetInsightEvents = Binding.Service<GetInsightEvents>(
40 "AWS.XRay.GetInsightEvents",
41);