| 1 | import type * as smsvoice from "@distilled.cloud/aws/pinpoint-sms-voice-v2"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { PhoneNumber } from "./PhoneNumber.ts"; |
| 5 | |
| 6 | /** |
| 7 | * The `OriginationIdentity` is injected by the binding from the bound |
| 8 | * phone number; the caller supplies the keyword and its response message. |
| 9 | */ |
| 10 | export interface PutKeywordRequest extends Omit< |
| 11 | smsvoice.PutKeywordRequest, |
| 12 | "OriginationIdentity" |
| 13 | > {} |
| 14 | |
| 15 | /** |
| 16 | * Runtime binding for `sms-voice:PutKeyword`. |
| 17 | * |
| 18 | * Creates or updates a keyword on the bound origination phone number — |
| 19 | * when an end user texts the keyword to the number, End User Messaging |
| 20 | * SMS automatically replies with `KeywordMessage` (or opts them out / |
| 21 | * back in when `KeywordAction` is set). The deploy-time half grants |
| 22 | * `sms-voice:PutKeyword` on the number. Provide the implementation with |
| 23 | * `Effect.provide(AWS.PinpointSMSVoiceV2.PutKeywordHttp)`. |
| 24 | * ### Managing Keywords |
| 25 | * **Example:** Register an Auto-Reply Keyword |
| 26 | * ```typescript |
| 27 | * // init |
| 28 | * const putKeyword = yield* AWS.PinpointSMSVoiceV2.PutKeyword(number); |
| 29 | * |
| 30 | * // runtime |
| 31 | * yield* putKeyword({ |
| 32 | * Keyword: "INFO", |
| 33 | * KeywordMessage: "Visit https://example.com for details.", |
| 34 | * }); |
| 35 | * ``` |
| 36 | * |
| 37 | * @binding |
| 38 | */ |
| 39 | export interface PutKeyword extends Binding.Service< |
| 40 | PutKeyword, |
| 41 | "AWS.PinpointSMSVoiceV2.PutKeyword", |
| 42 | ( |
| 43 | phoneNumber: PhoneNumber, |
| 44 | ) => Effect.Effect< |
| 45 | ( |
| 46 | request: PutKeywordRequest, |
| 47 | ) => Effect.Effect<smsvoice.PutKeywordResult, smsvoice.PutKeywordError> |
| 48 | > |
| 49 | > {} |
| 50 | export const PutKeyword = Binding.Service<PutKeyword>( |
| 51 | "AWS.PinpointSMSVoiceV2.PutKeyword", |
| 52 | ); |