The best way to control Claude Code, Codex and more from any computer or phone

main
ts 39 lines 1.47 KB
Raw
1 import type * as ds from "@distilled.cloud/aws/directory-service";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import 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 */
30 export interface GetSnapshotLimits extends Binding.Service<
31 GetSnapshotLimits,
32 "AWS.DirectoryService.GetSnapshotLimits",
33 (
34 directory: Directory,
35 ) => Effect.Effect<() => Effect.Effect<ds.GetSnapshotLimitsResult, ds.GetSnapshotLimitsError>>
36 > {}
37 export const GetSnapshotLimits = Binding.Service<GetSnapshotLimits>(
38 "AWS.DirectoryService.GetSnapshotLimits",
39 );