| 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 RestoreTableFromBackupRequest extends Omit< |
| 7 | DynamoDB.RestoreTableFromBackupInput, |
| 8 | "TargetTableName" |
| 9 | > {} |
| 10 | |
| 11 | /** |
| 12 | * Runtime binding for `dynamodb:RestoreTableFromBackup`. |
| 13 | * |
| 14 | * Bind this operation to a source and a target `Table` inside a function |
| 15 | * runtime to get a callable that restores one of the source table's on-demand |
| 16 | * backups (by `BackupArn`) into the target, automatically injecting the |
| 17 | * target table name. Provide the `RestoreTableFromBackupHttp` layer on the |
| 18 | * Function to satisfy the binding. |
| 19 | * ### Backup and Restore |
| 20 | * **Example:** Restore a Backup into the Target Table |
| 21 | * ```typescript |
| 22 | * const restoreTableFromBackup = yield* AWS.DynamoDB.RestoreTableFromBackup( |
| 23 | * sourceTable, |
| 24 | * restoreTargetTable, |
| 25 | * ); |
| 26 | * |
| 27 | * const response = yield* restoreTableFromBackup({ BackupArn: backupArn }); |
| 28 | * const status = response.TableDescription?.TableStatus; |
| 29 | * ``` |
| 30 | * |
| 31 | * @binding |
| 32 | */ |
| 33 | export interface RestoreTableFromBackup extends Binding.Service< |
| 34 | RestoreTableFromBackup, |
| 35 | "AWS.DynamoDB.RestoreTableFromBackup", |
| 36 | <From extends Table, To extends Table>( |
| 37 | from: From, |
| 38 | to: To, |
| 39 | ) => Effect.Effect< |
| 40 | ( |
| 41 | request: RestoreTableFromBackupRequest, |
| 42 | ) => Effect.Effect< |
| 43 | DynamoDB.RestoreTableFromBackupOutput, |
| 44 | DynamoDB.RestoreTableFromBackupError |
| 45 | > |
| 46 | > |
| 47 | > {} |
| 48 | export const RestoreTableFromBackup = Binding.Service<RestoreTableFromBackup>( |
| 49 | "AWS.DynamoDB.RestoreTableFromBackup", |
| 50 | ); |