@devries-cameron20 / t3code Mirror · read-only
Fork 0

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

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 06:00 UTC

main
ts 38 lines 1.35 KB
Raw
1 import type * as efs from "@distilled.cloud/aws/efs";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { FileSystem } from "./FileSystem.ts";
5
6 /**
7 * Runtime binding for the `DescribeBackupPolicy` operation (IAM action
8 * `elasticfilesystem:DescribeBackupPolicy` on the file system ARN).
9 *
10 * Reads whether AWS Backup automatic backups are enabled for the bound
11 * {@link FileSystem}. A file system that has never had a backup policy
12 * fails with the typed `PolicyNotFound`. Provide the implementation with
13 * `Effect.provide(AWS.EFS.DescribeBackupPolicyHttp)`.
14 * ### Backup Policy
15 * **Example:** Read the backup policy status
16 * ```typescript
17 * const describeBackupPolicy = yield* AWS.EFS.DescribeBackupPolicy(files);
18 *
19 * const status = yield* describeBackupPolicy().pipe(
20 * Effect.map((r) => r.BackupPolicy?.Status ?? "DISABLED"),
21 * Effect.catchTag("PolicyNotFound", () => Effect.succeed("DISABLED")),
22 * );
23 * ```
24 *
25 * @binding
26 */
27 export interface DescribeBackupPolicy extends Binding.Service<
28 DescribeBackupPolicy,
29 "AWS.EFS.DescribeBackupPolicy",
30 (
31 fileSystem: FileSystem,
32 ) => Effect.Effect<
33 () => Effect.Effect<efs.BackupPolicyDescription, efs.DescribeBackupPolicyError>
34 >
35 > {}
36 export const DescribeBackupPolicy = Binding.Service<DescribeBackupPolicy>(
37 "AWS.EFS.DescribeBackupPolicy",
38 );