| 1 | import type * as socialmessaging from "@distilled.cloud/aws/socialmessaging"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { LinkedWhatsAppBusinessAccount } from "./LinkedWhatsAppBusinessAccount.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for `social-messaging:GetLinkedWhatsAppBusinessAccountPhoneNumber`. |
| 8 | * |
| 9 | * Retrieves the details (display name, quality rating, Meta ids) of one of |
| 10 | * the linked account's WhatsApp phone numbers, plus the owning WABA id. |
| 11 | * |
| 12 | * The caller addresses one of the bound account's phone numbers per |
| 13 | * request; phone-number ARNs are provisioned by Meta under the WABA, so |
| 14 | * the deploy-time half grants `social-messaging:GetLinkedWhatsAppBusinessAccountPhoneNumber` on `*`. |
| 15 | * Provide the implementation with |
| 16 | * `Effect.provide(AWS.SocialMessaging.GetLinkedWhatsAppBusinessAccountPhoneNumberHttp)`. |
| 17 | * ### Reading Phone Numbers |
| 18 | * **Example:** Read Phone Number Details |
| 19 | * ```typescript |
| 20 | * // init — bind the operation to the linked WABA |
| 21 | * const getPhoneNumber = yield* AWS.SocialMessaging.GetLinkedWhatsAppBusinessAccountPhoneNumber(account); |
| 22 | * |
| 23 | * // runtime |
| 24 | * const details = yield* getPhoneNumber({ |
| 25 | * id: "phone-number-id-0123456789abcdef", |
| 26 | * }); |
| 27 | * const rating = details.phoneNumber?.qualityRating; |
| 28 | * ``` |
| 29 | * |
| 30 | * @binding |
| 31 | */ |
| 32 | export interface GetLinkedWhatsAppBusinessAccountPhoneNumber extends Binding.Service< |
| 33 | GetLinkedWhatsAppBusinessAccountPhoneNumber, |
| 34 | "AWS.SocialMessaging.GetLinkedWhatsAppBusinessAccountPhoneNumber", |
| 35 | ( |
| 36 | account: LinkedWhatsAppBusinessAccount, |
| 37 | ) => Effect.Effect< |
| 38 | ( |
| 39 | request: socialmessaging.GetLinkedWhatsAppBusinessAccountPhoneNumberInput, |
| 40 | ) => Effect.Effect< |
| 41 | socialmessaging.GetLinkedWhatsAppBusinessAccountPhoneNumberOutput, |
| 42 | socialmessaging.GetLinkedWhatsAppBusinessAccountPhoneNumberError |
| 43 | > |
| 44 | > |
| 45 | > {} |
| 46 | export const GetLinkedWhatsAppBusinessAccountPhoneNumber = |
| 47 | Binding.Service<GetLinkedWhatsAppBusinessAccountPhoneNumber>( |
| 48 | "AWS.SocialMessaging.GetLinkedWhatsAppBusinessAccountPhoneNumber", |
| 49 | ); |