1import type * as smsvoice from "@distilled.cloud/aws/pinpoint-sms-voice-v2";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import 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 destination, body, and media URLs.
9 */
10export interface SendMediaMessageRequest extends Omit<
11 smsvoice.SendMediaMessageRequest,
12 "OriginationIdentity"
13> {}
14
15/**
16 * Runtime binding for `sms-voice:SendMediaMessage`.
17 *
18 * Sends a multimedia message (MMS) from the bound origination phone
19 * number. `MediaUrls` reference S3 objects (`s3://bucket/key`) holding the
20 * attachments. The deploy-time half grants `sms-voice:SendMediaMessage` on
21 * the number and the runtime half injects its ARN as the request's
22 * `OriginationIdentity`. The bound number must carry the `MMS` capability.
23 * Provide the implementation with
24 * `Effect.provide(AWS.PinpointSMSVoiceV2.SendMediaMessageHttp)`.
25 * ### Sending Media Messages
26 * **Example:** Send an MMS with an S3 Attachment
27 * ```typescript
28 * // init
29 * const sendMedia = yield* AWS.PinpointSMSVoiceV2.SendMediaMessage(number);
30 *
31 * // runtime
32 * const { MessageId } = yield* sendMedia({
33 * DestinationPhoneNumber: "+12065550100",
34 * MessageBody: "Here is your receipt",
35 * MediaUrls: ["s3://my-bucket/receipts/1234.png"],
36 * });
37 * ```
38 *
39 * @binding
40 */
41export interface SendMediaMessage extends Binding.Service<
42 SendMediaMessage,
43 "AWS.PinpointSMSVoiceV2.SendMediaMessage",
44 (
45 phoneNumber: PhoneNumber,
46 ) => Effect.Effect<
47 (
48 request: SendMediaMessageRequest,
49 ) => Effect.Effect<
50 smsvoice.SendMediaMessageResult,
51 smsvoice.SendMediaMessageError
52 >
53 >
54> {}
55export const SendMediaMessage = Binding.Service<SendMediaMessage>(
56 "AWS.PinpointSMSVoiceV2.SendMediaMessage",
57);