| 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 DescribeTimeToLiveRequest extends Omit< |
| 7 | DynamoDB.DescribeTimeToLiveInput, |
| 8 | "TableName" |
| 9 | > {} |
| 10 | |
| 11 | /** |
| 12 | * Runtime binding for `dynamodb:DescribeTimeToLive`. |
| 13 | * |
| 14 | * Bind this operation to a `Table` inside a function runtime to get a callable |
| 15 | * that reads the table's TTL configuration. Provide the |
| 16 | * `DescribeTimeToLiveHttp` layer on the Function to satisfy the binding. |
| 17 | * ### Time to Live |
| 18 | * **Example:** Read the TTL Configuration |
| 19 | * ```typescript |
| 20 | * const describeTimeToLive = yield* AWS.DynamoDB.DescribeTimeToLive(table); |
| 21 | * |
| 22 | * const response = yield* describeTimeToLive(); |
| 23 | * const ttlStatus = response.TimeToLiveDescription?.TimeToLiveStatus; |
| 24 | * ``` |
| 25 | * |
| 26 | * @binding |
| 27 | */ |
| 28 | export interface DescribeTimeToLive extends Binding.Service< |
| 29 | DescribeTimeToLive, |
| 30 | "AWS.DynamoDB.DescribeTimeToLive", |
| 31 | <T extends Table>( |
| 32 | table: T, |
| 33 | ) => Effect.Effect< |
| 34 | ( |
| 35 | request?: DescribeTimeToLiveRequest, |
| 36 | ) => Effect.Effect< |
| 37 | DynamoDB.DescribeTimeToLiveOutput, |
| 38 | DynamoDB.DescribeTimeToLiveError |
| 39 | > |
| 40 | > |
| 41 | > {} |
| 42 | export const DescribeTimeToLive = Binding.Service<DescribeTimeToLive>( |
| 43 | "AWS.DynamoDB.DescribeTimeToLive", |
| 44 | ); |