| 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 DescribeBackupRequest extends DynamoDB.DescribeBackupInput {} |
| 7 | |
| 8 | /** |
| 9 | * Runtime binding for `dynamodb:DescribeBackup`. |
| 10 | * |
| 11 | * Bind this operation to a `Table` inside a function runtime to get a callable |
| 12 | * that reads the status and details of one of the bound table's backups by |
| 13 | * ARN. The IAM grant covers every backup of the bound table |
| 14 | * (`{tableArn}/backup/*`). Provide the `DescribeBackupHttp` layer on the |
| 15 | * Function to satisfy the binding. |
| 16 | * ### Backup and Restore |
| 17 | * **Example:** Poll a Backup Until It Is Available |
| 18 | * ```typescript |
| 19 | * const describeBackup = yield* AWS.DynamoDB.DescribeBackup(table); |
| 20 | * |
| 21 | * const response = yield* describeBackup({ BackupArn: backupArn }); |
| 22 | * const status = response.BackupDescription?.BackupDetails?.BackupStatus; |
| 23 | * ``` |
| 24 | * |
| 25 | * @binding |
| 26 | */ |
| 27 | export interface DescribeBackup extends Binding.Service< |
| 28 | DescribeBackup, |
| 29 | "AWS.DynamoDB.DescribeBackup", |
| 30 | <T extends Table>( |
| 31 | table: T, |
| 32 | ) => Effect.Effect< |
| 33 | ( |
| 34 | request: DescribeBackupRequest, |
| 35 | ) => Effect.Effect< |
| 36 | DynamoDB.DescribeBackupOutput, |
| 37 | DynamoDB.DescribeBackupError |
| 38 | > |
| 39 | > |
| 40 | > {} |
| 41 | export const DescribeBackup = Binding.Service<DescribeBackup>( |
| 42 | "AWS.DynamoDB.DescribeBackup", |
| 43 | ); |