| 1 | import type * as lexr from "@distilled.cloud/aws/lex-runtime-v2"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { BotAlias } from "./BotAlias.ts"; |
| 5 | |
| 6 | /** |
| 7 | * The `DeleteSession` request with the binding-injected `botId` and |
| 8 | * `botAliasId` removed. |
| 9 | */ |
| 10 | export interface DeleteSessionRequest extends Omit< |
| 11 | lexr.DeleteSessionRequest, |
| 12 | "botId" | "botAliasId" |
| 13 | > {} |
| 14 | |
| 15 | /** |
| 16 | * Runtime binding for `lex:DeleteSession` — end a conversation with an |
| 17 | * Amazon Lex V2 bot alias, discarding its session state so the next user |
| 18 | * input starts a fresh conversation. |
| 19 | * |
| 20 | * ### Managing Sessions |
| 21 | * **Example:** Reset a User's Conversation |
| 22 | * ```typescript |
| 23 | * // init |
| 24 | * const deleteSession = yield* AWS.LexV2.DeleteSession(alias); |
| 25 | * |
| 26 | * // runtime |
| 27 | * yield* deleteSession({ |
| 28 | * localeId: "en_US", |
| 29 | * sessionId: "user-123", |
| 30 | * }); |
| 31 | * ``` |
| 32 | * |
| 33 | * @binding |
| 34 | */ |
| 35 | export interface DeleteSession extends Binding.Service< |
| 36 | DeleteSession, |
| 37 | "AWS.LexV2.DeleteSession", |
| 38 | ( |
| 39 | alias: BotAlias, |
| 40 | ) => Effect.Effect< |
| 41 | ( |
| 42 | request: DeleteSessionRequest, |
| 43 | ) => Effect.Effect<lexr.DeleteSessionResponse, lexr.DeleteSessionError> |
| 44 | > |
| 45 | > {} |
| 46 | |
| 47 | export const DeleteSession = Binding.Service<DeleteSession>( |
| 48 | "AWS.LexV2.DeleteSession", |
| 49 | ); |