| 1 | import type * as detective from "@distilled.cloud/aws/detective"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Graph } from "./Graph.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for `detective:GetInvestigation`. |
| 8 | * |
| 9 | * Reads a single investigation's detail — entity, scope window, status, |
| 10 | * severity, and state — so a triage function can poll a running |
| 11 | * investigation to completion. The graph ARN is injected from the bound |
| 12 | * {@link Graph}. |
| 13 | * Provide the implementation with |
| 14 | * `Effect.provide(AWS.Detective.GetInvestigationHttp)`. |
| 15 | * ### Running Investigations |
| 16 | * **Example:** Poll An Investigation |
| 17 | * ```typescript |
| 18 | * // init |
| 19 | * const getInvestigation = yield* AWS.Detective.GetInvestigation(graph); |
| 20 | * |
| 21 | * // runtime |
| 22 | * const detail = yield* getInvestigation({ InvestigationId: id }); |
| 23 | * if (detail.Status === "SUCCESSFUL") { |
| 24 | * yield* Effect.log(`severity: ${detail.Severity}`); |
| 25 | * } |
| 26 | * ``` |
| 27 | * |
| 28 | * @binding |
| 29 | */ |
| 30 | export interface GetInvestigation extends Binding.Service< |
| 31 | GetInvestigation, |
| 32 | "AWS.Detective.GetInvestigation", |
| 33 | ( |
| 34 | graph: Graph, |
| 35 | ) => Effect.Effect< |
| 36 | ( |
| 37 | request: Omit<detective.GetInvestigationRequest, "GraphArn">, |
| 38 | ) => Effect.Effect< |
| 39 | detective.GetInvestigationResponse, |
| 40 | detective.GetInvestigationError |
| 41 | > |
| 42 | > |
| 43 | > {} |
| 44 | export const GetInvestigation = Binding.Service<GetInvestigation>( |
| 45 | "AWS.Detective.GetInvestigation", |
| 46 | ); |