| 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 { OptOutList } from "./OptOutList.ts"; |
| 5 | |
| 6 | /** |
| 7 | * The `OptOutListName` is injected by the binding from the bound opt-out |
| 8 | * list; the caller supplies the destination number to opt out. |
| 9 | */ |
| 10 | export interface PutOptedOutNumberRequest extends Omit< |
| 11 | smsvoice.PutOptedOutNumberRequest, |
| 12 | "OptOutListName" |
| 13 | > {} |
| 14 | |
| 15 | /** |
| 16 | * Runtime binding for `sms-voice:PutOptedOutNumber`. |
| 17 | * |
| 18 | * Adds a destination phone number to the bound opt-out list — further |
| 19 | * messages to it through numbers using this list are suppressed. Use it |
| 20 | * to honor opt-out requests arriving through channels other than the |
| 21 | * carrier keywords (support tickets, web forms). The deploy-time half |
| 22 | * grants `sms-voice:PutOptedOutNumber` on the list. Provide the |
| 23 | * implementation with |
| 24 | * `Effect.provide(AWS.PinpointSMSVoiceV2.PutOptedOutNumberHttp)`. |
| 25 | * ### Managing Opt-Outs |
| 26 | * **Example:** Opt a Number Out from a Lambda |
| 27 | * ```typescript |
| 28 | * // init |
| 29 | * const optOuts = yield* AWS.PinpointSMSVoiceV2.OptOutList("OptOuts"); |
| 30 | * const putOptedOut = yield* AWS.PinpointSMSVoiceV2.PutOptedOutNumber(optOuts); |
| 31 | * |
| 32 | * // runtime |
| 33 | * yield* putOptedOut({ OptedOutNumber: "+12065550100" }); |
| 34 | * ``` |
| 35 | * |
| 36 | * @binding |
| 37 | */ |
| 38 | export interface PutOptedOutNumber extends Binding.Service< |
| 39 | PutOptedOutNumber, |
| 40 | "AWS.PinpointSMSVoiceV2.PutOptedOutNumber", |
| 41 | ( |
| 42 | optOutList: OptOutList, |
| 43 | ) => Effect.Effect< |
| 44 | ( |
| 45 | request: PutOptedOutNumberRequest, |
| 46 | ) => Effect.Effect< |
| 47 | smsvoice.PutOptedOutNumberResult, |
| 48 | smsvoice.PutOptedOutNumberError |
| 49 | > |
| 50 | > |
| 51 | > {} |
| 52 | export const PutOptedOutNumber = Binding.Service<PutOptedOutNumber>( |
| 53 | "AWS.PinpointSMSVoiceV2.PutOptedOutNumber", |
| 54 | ); |