1import type * as efs from "@distilled.cloud/aws/efs";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import 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 */
27export interface DescribeBackupPolicy extends Binding.Service<
28 DescribeBackupPolicy,
29 "AWS.EFS.DescribeBackupPolicy",
30 (
31 fileSystem: FileSystem,
32 ) => Effect.Effect<
33 () => Effect.Effect<
34 efs.BackupPolicyDescription,
35 efs.DescribeBackupPolicyError
36 >
37 >
38> {}
39export const DescribeBackupPolicy = Binding.Service<DescribeBackupPolicy>(
40 "AWS.EFS.DescribeBackupPolicy",
41);