| 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 `StartImportTask` operation (IAM action `neptune-graph:StartImportTask`), |
| 8 | * scoped to one {@link Graph}. |
| 9 | * |
| 10 | * Starts a bulk import from Amazon S3 into the bound graph (the graph must be empty and `AVAILABLE`). The request passes Neptune Analytics a data-access role, so the grant includes `iam:PassRole` conditioned to `neptune-graph.amazonaws.com`. Poll progress with {@link GetImportTask}. Provide the implementation with |
| 11 | * `Effect.provide(AWS.NeptuneGraph.StartImportTaskHttp)`. |
| 12 | * ### Importing and Exporting Data |
| 13 | * **Example:** Bulk-load CSV data from S3 |
| 14 | * ```typescript |
| 15 | * const startImport = yield* NeptuneGraph.StartImportTask(graph); |
| 16 | * |
| 17 | * const task = yield* startImport({ |
| 18 | * source: "s3://my-bucket/graph-data/", |
| 19 | * format: "CSV", |
| 20 | * roleArn: importRole.roleArn, |
| 21 | * }); |
| 22 | * // task.taskId, task.status |
| 23 | * ``` |
| 24 | * |
| 25 | * @binding |
| 26 | */ |
| 27 | export interface StartImportTask extends Binding.Service< |
| 28 | StartImportTask, |
| 29 | "AWS.NeptuneGraph.StartImportTask", |
| 30 | ( |
| 31 | graph: Graph, |
| 32 | ) => Effect.Effect< |
| 33 | ( |
| 34 | request: Omit<neptunegraph.StartImportTaskInput, "graphIdentifier">, |
| 35 | ) => Effect.Effect< |
| 36 | neptunegraph.StartImportTaskOutput, |
| 37 | neptunegraph.StartImportTaskError |
| 38 | > |
| 39 | > |
| 40 | > {} |
| 41 | export const StartImportTask = Binding.Service<StartImportTask>( |
| 42 | "AWS.NeptuneGraph.StartImportTask", |
| 43 | ); |