1import type * as DynamoDB from "@distilled.cloud/aws/dynamodb";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { Bucket } from "../S3/Bucket.ts";
5import type { Table } from "./Table.ts";
6
7export interface ExportTableToPointInTimeRequest extends Omit<
8 DynamoDB.ExportTableToPointInTimeInput,
9 "TableArn" | "S3Bucket"
10> {}
11
12/**
13 * Runtime binding for `dynamodb:ExportTableToPointInTime`.
14 *
15 * Bind this operation to a `Table` and a destination S3 `Bucket` inside a
16 * function runtime to get a callable that starts a point-in-time export of
17 * the table to the bucket, automatically injecting the table ARN and bucket
18 * name. The table must have point-in-time recovery enabled. The deploy-time
19 * half grants the export action on the table plus the S3 write permissions
20 * the export requires on the bucket. Provide the `ExportTableToPointInTimeHttp`
21 * layer on the Function to satisfy the binding.
22 * ### Exporting to S3
23 * **Example:** Start a Full Export
24 * ```typescript
25 * const exportTable = yield* AWS.DynamoDB.ExportTableToPointInTime(
26 * table,
27 * bucket,
28 * );
29 *
30 * const response = yield* exportTable({ ExportFormat: "DYNAMODB_JSON" });
31 * const exportArn = response.ExportDescription?.ExportArn;
32 * ```
33 *
34 * @binding
35 */
36export interface ExportTableToPointInTime extends Binding.Service<
37 ExportTableToPointInTime,
38 "AWS.DynamoDB.ExportTableToPointInTime",
39 <T extends Table, B extends Bucket>(
40 table: T,
41 bucket: B,
42 ) => Effect.Effect<
43 (
44 request?: ExportTableToPointInTimeRequest,
45 ) => Effect.Effect<
46 DynamoDB.ExportTableToPointInTimeOutput,
47 DynamoDB.ExportTableToPointInTimeError
48 >
49 >
50> {}
51export const ExportTableToPointInTime =
52 Binding.Service<ExportTableToPointInTime>(
53 "AWS.DynamoDB.ExportTableToPointInTime",
54 );