| 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 `CreateGraphSnapshot` operation (IAM actions `neptune-graph:CreateGraphSnapshot` + `neptune-graph:TagResource`), |
| 8 | * scoped to one {@link Graph}. |
| 9 | * |
| 10 | * Takes an on-demand snapshot of the bound graph — e.g. a pre-import backup from an operational Lambda. Snapshot creation is asynchronous; poll it with {@link GetGraphSnapshot}. Provide the implementation with |
| 11 | * `Effect.provide(AWS.NeptuneGraph.CreateGraphSnapshotHttp)`. |
| 12 | * ### Managing Snapshots |
| 13 | * **Example:** Take an on-demand snapshot |
| 14 | * ```typescript |
| 15 | * const createSnapshot = yield* NeptuneGraph.CreateGraphSnapshot(graph); |
| 16 | * |
| 17 | * const snapshot = yield* createSnapshot({ snapshotName: "pre-import" }); |
| 18 | * // snapshot.status → "CREATING" |
| 19 | * ``` |
| 20 | * |
| 21 | * @binding |
| 22 | */ |
| 23 | export interface CreateGraphSnapshot extends Binding.Service< |
| 24 | CreateGraphSnapshot, |
| 25 | "AWS.NeptuneGraph.CreateGraphSnapshot", |
| 26 | ( |
| 27 | graph: Graph, |
| 28 | ) => Effect.Effect< |
| 29 | ( |
| 30 | request: Omit<neptunegraph.CreateGraphSnapshotInput, "graphIdentifier">, |
| 31 | ) => Effect.Effect< |
| 32 | neptunegraph.CreateGraphSnapshotOutput, |
| 33 | neptunegraph.CreateGraphSnapshotError |
| 34 | > |
| 35 | > |
| 36 | > {} |
| 37 | export const CreateGraphSnapshot = Binding.Service<CreateGraphSnapshot>( |
| 38 | "AWS.NeptuneGraph.CreateGraphSnapshot", |
| 39 | ); |