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 * `PutBackupPolicy` request with `FileSystemId` injected from the bound
8 * {@link FileSystem}.
9 */
10export interface PutBackupPolicyRequest extends Omit<
11 efs.PutBackupPolicyRequest,
12 "FileSystemId"
13> {}
14
15/**
16 * Runtime binding for the `PutBackupPolicy` operation (IAM action
17 * `elasticfilesystem:PutBackupPolicy` on the file system ARN).
18 *
19 * Starts or stops AWS Backup automatic backups for the bound
20 * {@link FileSystem} at runtime. For declarative control, prefer the
21 * FileSystem resource's `backup` prop — this binding is for operational
22 * tooling that toggles backups on demand. Provide the implementation with
23 * `Effect.provide(AWS.EFS.PutBackupPolicyHttp)`.
24 * ### Backup Policy
25 * **Example:** Enable automatic backups
26 * ```typescript
27 * const putBackupPolicy = yield* AWS.EFS.PutBackupPolicy(files);
28 *
29 * const { BackupPolicy } = yield* putBackupPolicy({
30 * BackupPolicy: { Status: "ENABLED" },
31 * });
32 * ```
33 *
34 * @binding
35 */
36export interface PutBackupPolicy extends Binding.Service<
37 PutBackupPolicy,
38 "AWS.EFS.PutBackupPolicy",
39 (
40 fileSystem: FileSystem,
41 ) => Effect.Effect<
42 (
43 request: PutBackupPolicyRequest,
44 ) => Effect.Effect<efs.BackupPolicyDescription, efs.PutBackupPolicyError>
45 >
46> {}
47export const PutBackupPolicy = Binding.Service<PutBackupPolicy>(
48 "AWS.EFS.PutBackupPolicy",
49);