1import type * as ds from "@distilled.cloud/aws/directory-service";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { Directory } from "./Directory.ts";
5
6/**
7 * Runtime binding for the `DescribeSnapshots` operation (IAM action
8 * `ds:DescribeSnapshots`), scoped to one {@link Directory}.
9 *
10 * Lists the bound directory's snapshots — id, type (`Auto`/`Manual`),
11 * status, and start time. The directory id is injected from the binding.
12 * Provide the implementation with
13 * `Effect.provide(AWS.DirectoryService.DescribeSnapshotsHttp)`.
14 * ### Managing Snapshots
15 * **Example:** List the Directory's Snapshots
16 * ```typescript
17 * // init — bind the operation to the directory
18 * const describeSnapshots = yield* AWS.DirectoryService.DescribeSnapshots(directory);
19 *
20 * // runtime
21 * const { Snapshots } = yield* describeSnapshots();
22 * for (const snapshot of Snapshots ?? []) {
23 * console.log(snapshot.SnapshotId, snapshot.Status);
24 * }
25 * ```
26 *
27 * @binding
28 */
29export interface DescribeSnapshots extends Binding.Service<
30 DescribeSnapshots,
31 "AWS.DirectoryService.DescribeSnapshots",
32 (
33 directory: Directory,
34 ) => Effect.Effect<
35 (
36 request?: Omit<ds.DescribeSnapshotsRequest, "DirectoryId">,
37 ) => Effect.Effect<ds.DescribeSnapshotsResult, ds.DescribeSnapshotsError>
38 >
39> {}
40export const DescribeSnapshots = Binding.Service<DescribeSnapshots>(
41 "AWS.DirectoryService.DescribeSnapshots",
42);