| 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:UpdateInvestigationState`. |
| 8 | * |
| 9 | * Moves an investigation between `ACTIVE` and `ARCHIVED` — close out a |
| 10 | * triaged investigation from the same function that opened it. The graph |
| 11 | * ARN is injected from the bound {@link Graph}. |
| 12 | * Provide the implementation with |
| 13 | * `Effect.provide(AWS.Detective.UpdateInvestigationStateHttp)`. |
| 14 | * ### Running Investigations |
| 15 | * **Example:** Archive A Triaged Investigation |
| 16 | * ```typescript |
| 17 | * // init |
| 18 | * const updateInvestigationState = |
| 19 | * yield* AWS.Detective.UpdateInvestigationState(graph); |
| 20 | * |
| 21 | * // runtime |
| 22 | * yield* updateInvestigationState({ InvestigationId: id, State: "ARCHIVED" }); |
| 23 | * ``` |
| 24 | * |
| 25 | * @binding |
| 26 | */ |
| 27 | export interface UpdateInvestigationState extends Binding.Service< |
| 28 | UpdateInvestigationState, |
| 29 | "AWS.Detective.UpdateInvestigationState", |
| 30 | ( |
| 31 | graph: Graph, |
| 32 | ) => Effect.Effect< |
| 33 | ( |
| 34 | request: Omit<detective.UpdateInvestigationStateRequest, "GraphArn">, |
| 35 | ) => Effect.Effect< |
| 36 | detective.UpdateInvestigationStateResponse, |
| 37 | detective.UpdateInvestigationStateError |
| 38 | > |
| 39 | > |
| 40 | > {} |
| 41 | export const UpdateInvestigationState = |
| 42 | Binding.Service<UpdateInvestigationState>( |
| 43 | "AWS.Detective.UpdateInvestigationState", |
| 44 | ); |