| 1 | import * as DynamoDB from "@distilled.cloud/aws/dynamodb"; |
| 2 | import * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Table } from "./Table.ts"; |
| 5 | |
| 6 | export interface RestoreTableToPointInTimeRequest extends Omit< |
| 7 | DynamoDB.RestoreTableToPointInTimeInput, |
| 8 | "SourceTableArn" | "SourceTableName" | "TargetTableName" |
| 9 | > {} |
| 10 | |
| 11 | /** |
| 12 | * Runtime binding for `dynamodb:RestoreTableToPointInTime`. |
| 13 | * |
| 14 | * Bind this operation to a source and a target `Table` inside a function |
| 15 | * runtime to get a callable that restores the source's point-in-time backup |
| 16 | * into the target, automatically injecting both table identifiers. The source |
| 17 | * table must have point-in-time recovery enabled. Provide the |
| 18 | * `RestoreTableToPointInTimeHttp` layer on the Function to satisfy the |
| 19 | * binding. |
| 20 | * ### Backup and Restore |
| 21 | * **Example:** Restore to the Latest Restorable Time |
| 22 | * ```typescript |
| 23 | * const restore = yield* AWS.DynamoDB.RestoreTableToPointInTime( |
| 24 | * sourceTable, |
| 25 | * restoreTargetTable, |
| 26 | * ); |
| 27 | * |
| 28 | * const response = yield* restore({ |
| 29 | * UseLatestRestorableTime: true, |
| 30 | * }); |
| 31 | * const status = response.TableDescription?.TableStatus; |
| 32 | * ``` |
| 33 | * |
| 34 | * @binding |
| 35 | */ |
| 36 | export interface RestoreTableToPointInTime extends Binding.Service< |
| 37 | RestoreTableToPointInTime, |
| 38 | "AWS.DynamoDB.RestoreTableToPointInTime", |
| 39 | <From extends Table, To extends Table>( |
| 40 | from: From, |
| 41 | to: To, |
| 42 | ) => Effect.Effect< |
| 43 | ( |
| 44 | request: RestoreTableToPointInTimeRequest, |
| 45 | ) => Effect.Effect< |
| 46 | DynamoDB.RestoreTableToPointInTimeOutput, |
| 47 | DynamoDB.RestoreTableToPointInTimeError |
| 48 | > |
| 49 | > |
| 50 | > {} |
| 51 | |
| 52 | export const RestoreTableToPointInTime = |
| 53 | Binding.Service<RestoreTableToPointInTime>( |
| 54 | "AWS.DynamoDB.RestoreTableToPointInTime", |
| 55 | ); |