| 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 UpdateTimeToLiveRequest extends Omit< |
| 7 | DynamoDB.UpdateTimeToLiveInput, |
| 8 | "TableName" |
| 9 | > {} |
| 10 | |
| 11 | /** |
| 12 | * Runtime binding for `dynamodb:UpdateTimeToLive`. |
| 13 | * |
| 14 | * Bind this operation to a `Table` inside a function runtime to get a callable |
| 15 | * that enables or disables TTL expiry on an attribute. Provide the |
| 16 | * `UpdateTimeToLiveHttp` layer on the Function to satisfy the binding. |
| 17 | * ### Time to Live |
| 18 | * **Example:** Enable TTL on an Attribute |
| 19 | * ```typescript |
| 20 | * const updateTimeToLive = yield* AWS.DynamoDB.UpdateTimeToLive(table); |
| 21 | * |
| 22 | * yield* updateTimeToLive({ |
| 23 | * TimeToLiveSpecification: { |
| 24 | * AttributeName: "expiresAt", |
| 25 | * Enabled: true, |
| 26 | * }, |
| 27 | * }); |
| 28 | * ``` |
| 29 | * |
| 30 | * @binding |
| 31 | */ |
| 32 | export interface UpdateTimeToLive extends Binding.Service< |
| 33 | UpdateTimeToLive, |
| 34 | "AWS.DynamoDB.UpdateTimeToLive", |
| 35 | <T extends Table>( |
| 36 | table: T, |
| 37 | ) => Effect.Effect< |
| 38 | ( |
| 39 | request: UpdateTimeToLiveRequest, |
| 40 | ) => Effect.Effect< |
| 41 | DynamoDB.UpdateTimeToLiveOutput, |
| 42 | DynamoDB.UpdateTimeToLiveError |
| 43 | > |
| 44 | > |
| 45 | > {} |
| 46 | export const UpdateTimeToLive = Binding.Service<UpdateTimeToLive>( |
| 47 | "AWS.DynamoDB.UpdateTimeToLive", |
| 48 | ); |