| 1 | import type * as ds from "@distilled.cloud/aws/directory-service"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Directory } from "./Directory.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for the `CreateSnapshot` operation (IAM action |
| 8 | * `ds:CreateSnapshot`), scoped to one {@link Directory}. |
| 9 | * |
| 10 | * Takes a manual snapshot of the bound Simple AD or Managed Microsoft AD |
| 11 | * directory — e.g. before a scheduled change — returning the new |
| 12 | * `SnapshotId`. Manual snapshots are limited per directory (see |
| 13 | * {@link GetSnapshotLimits}). The directory id is injected from the binding. |
| 14 | * Provide the implementation with |
| 15 | * `Effect.provide(AWS.DirectoryService.CreateSnapshotHttp)`. |
| 16 | * ### Managing Snapshots |
| 17 | * **Example:** Snapshot the Directory Before a Change |
| 18 | * ```typescript |
| 19 | * // init — bind the operation to the directory |
| 20 | * const createSnapshot = yield* AWS.DirectoryService.CreateSnapshot(directory); |
| 21 | * |
| 22 | * // runtime |
| 23 | * const { SnapshotId } = yield* createSnapshot({ Name: "pre-migration" }); |
| 24 | * ``` |
| 25 | * |
| 26 | * @binding |
| 27 | */ |
| 28 | export interface CreateSnapshot extends Binding.Service< |
| 29 | CreateSnapshot, |
| 30 | "AWS.DirectoryService.CreateSnapshot", |
| 31 | ( |
| 32 | directory: Directory, |
| 33 | ) => Effect.Effect< |
| 34 | ( |
| 35 | request?: Omit<ds.CreateSnapshotRequest, "DirectoryId">, |
| 36 | ) => Effect.Effect<ds.CreateSnapshotResult, ds.CreateSnapshotError> |
| 37 | > |
| 38 | > {} |
| 39 | export const CreateSnapshot = Binding.Service<CreateSnapshot>( |
| 40 | "AWS.DirectoryService.CreateSnapshot", |
| 41 | ); |