| 1 | import type * as DynamoDB from "@distilled.cloud/aws/dynamodb"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Table } from "./Table.ts"; |
| 5 | |
| 6 | export interface DeleteBackupRequest extends DynamoDB.DeleteBackupInput {} |
| 7 | |
| 8 | /** |
| 9 | * Runtime binding for `dynamodb:DeleteBackup`. |
| 10 | * |
| 11 | * Bind this operation to a `Table` inside a function runtime to get a callable |
| 12 | * that deletes one of the bound table's on-demand backups by ARN. The IAM |
| 13 | * grant covers every backup of the bound table (`{tableArn}/backup/*`). |
| 14 | * Provide the `DeleteBackupHttp` layer on the Function to satisfy the binding. |
| 15 | * ### Backup and Restore |
| 16 | * **Example:** Delete an Expired Backup |
| 17 | * ```typescript |
| 18 | * const deleteBackup = yield* AWS.DynamoDB.DeleteBackup(table); |
| 19 | * |
| 20 | * const response = yield* deleteBackup({ BackupArn: backupArn }); |
| 21 | * const status = response.BackupDescription?.BackupDetails?.BackupStatus; |
| 22 | * ``` |
| 23 | * |
| 24 | * @binding |
| 25 | */ |
| 26 | export interface DeleteBackup extends Binding.Service< |
| 27 | DeleteBackup, |
| 28 | "AWS.DynamoDB.DeleteBackup", |
| 29 | <T extends Table>( |
| 30 | table: T, |
| 31 | ) => Effect.Effect< |
| 32 | ( |
| 33 | request: DeleteBackupRequest, |
| 34 | ) => Effect.Effect<DynamoDB.DeleteBackupOutput, DynamoDB.DeleteBackupError> |
| 35 | > |
| 36 | > {} |
| 37 | export const DeleteBackup = Binding.Service<DeleteBackup>( |
| 38 | "AWS.DynamoDB.DeleteBackup", |
| 39 | ); |