| 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 ListRetrievedTracesRequest |
| 6 | extends xray.ListRetrievedTracesRequest {} |
| 7 | |
| 8 | /** |
| 9 | * Retrieve the traces fetched by a Transaction Search retrieval job. |
| 10 | * Returns an empty response until the job's `RetrievalStatus` is |
| 11 | * `COMPLETE`. |
| 12 | * |
| 13 | * Bind the operation in the function's init phase to get a runtime callable; |
| 14 | * provide the implementation with `Effect.provide(XRay.ListRetrievedTracesHttp)`. |
| 15 | * The action is account-scoped: X-Ray does not support resource-level |
| 16 | * permissions for `xray:ListRetrievedTraces`, so the binding grants it on `*`. |
| 17 | * ### Transaction Search |
| 18 | * **Example:** Poll a retrieval job for its traces |
| 19 | * ```typescript |
| 20 | * import * as XRay from "alchemy/AWS/XRay"; |
| 21 | * |
| 22 | * // init — grants xray:ListRetrievedTraces |
| 23 | * const listRetrievedTraces = yield* XRay.ListRetrievedTraces(); |
| 24 | * |
| 25 | * // runtime |
| 26 | * const result = yield* listRetrievedTraces({ RetrievalToken: token }); |
| 27 | * if (result.RetrievalStatus === "COMPLETE") { |
| 28 | * const traces = result.Traces ?? []; |
| 29 | * } |
| 30 | * ``` |
| 31 | * |
| 32 | * @binding |
| 33 | */ |
| 34 | export interface ListRetrievedTraces extends Binding.Service< |
| 35 | ListRetrievedTraces, |
| 36 | "AWS.XRay.ListRetrievedTraces", |
| 37 | () => Effect.Effect< |
| 38 | ( |
| 39 | request: ListRetrievedTracesRequest, |
| 40 | ) => Effect.Effect< |
| 41 | xray.ListRetrievedTracesResult, |
| 42 | xray.ListRetrievedTracesError |
| 43 | > |
| 44 | > |
| 45 | > {} |
| 46 | export const ListRetrievedTraces = Binding.Service<ListRetrievedTraces>( |
| 47 | "AWS.XRay.ListRetrievedTraces", |
| 48 | ); |