| 1 | import type * as neptunegraph from "@distilled.cloud/aws/neptune-graph"; |
| 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 the `ResetGraph` operation (IAM action `neptune-graph:ResetGraph`), |
| 8 | * scoped to one {@link Graph}. |
| 9 | * |
| 10 | * Empties all data from the bound graph while keeping the graph itself (and optionally snapshotting first) — e.g. refresh a demo or staging dataset before a re-import. Provide the implementation with |
| 11 | * `Effect.provide(AWS.NeptuneGraph.ResetGraphHttp)`. |
| 12 | * ### Resetting a Graph |
| 13 | * **Example:** Wipe all data from a graph |
| 14 | * ```typescript |
| 15 | * const resetGraph = yield* NeptuneGraph.ResetGraph(graph); |
| 16 | * |
| 17 | * yield* resetGraph({ skipSnapshot: true }); |
| 18 | * ``` |
| 19 | * |
| 20 | * @binding |
| 21 | */ |
| 22 | export interface ResetGraph extends Binding.Service< |
| 23 | ResetGraph, |
| 24 | "AWS.NeptuneGraph.ResetGraph", |
| 25 | ( |
| 26 | graph: Graph, |
| 27 | ) => Effect.Effect< |
| 28 | ( |
| 29 | request: Omit<neptunegraph.ResetGraphInput, "graphIdentifier">, |
| 30 | ) => Effect.Effect< |
| 31 | neptunegraph.ResetGraphOutput, |
| 32 | neptunegraph.ResetGraphError |
| 33 | > |
| 34 | > |
| 35 | > {} |
| 36 | export const ResetGraph = Binding.Service<ResetGraph>( |
| 37 | "AWS.NeptuneGraph.ResetGraph", |
| 38 | ); |