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 `GetSnapshotLimits` operation (IAM action
8 * `ds:GetSnapshotLimits`), scoped to one {@link Directory}.
9 *
10 * Reads the bound directory's manual snapshot limits — how many manual
11 * snapshots exist versus the allowed maximum — so a backup function can
12 * prune before taking a new snapshot. The directory id is injected from the
13 * binding. Provide the implementation with
14 * `Effect.provide(AWS.DirectoryService.GetSnapshotLimitsHttp)`.
15 * ### Managing Snapshots
16 * **Example:** Check the Manual Snapshot Quota
17 * ```typescript
18 * // init — bind the operation to the directory
19 * const getSnapshotLimits = yield* AWS.DirectoryService.GetSnapshotLimits(directory);
20 *
21 * // runtime
22 * const { SnapshotLimits } = yield* getSnapshotLimits();
23 * if (SnapshotLimits?.ManualSnapshotsLimitReached) {
24 * yield* Effect.logWarning("manual snapshot limit reached");
25 * }
26 * ```
27 *
28 * @binding
29 */
30export interface GetSnapshotLimits extends Binding.Service<
31 GetSnapshotLimits,
32 "AWS.DirectoryService.GetSnapshotLimits",
33 (
34 directory: Directory,
35 ) => Effect.Effect<
36 () => Effect.Effect<ds.GetSnapshotLimitsResult, ds.GetSnapshotLimitsError>
37 >
38> {}
39export const GetSnapshotLimits = Binding.Service<GetSnapshotLimits>(
40 "AWS.DirectoryService.GetSnapshotLimits",
41);