The best way to control Claude Code, Codex and more from any computer or phone
| 1 | import type * as socialmessaging from "@distilled.cloud/aws/socialmessaging"; |
| 2 | import * as Binding from "alchemy/Binding"; |
| 3 | import type * as Effect from "effect/Effect"; |
| 4 | import type { LinkedWhatsAppBusinessAccount } from "./LinkedWhatsAppBusinessAccount.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Request for {@link GetWhatsAppFlow}. The linked WABA `id` is injected by |
| 8 | * the binding from the bound {@link LinkedWhatsAppBusinessAccount}. |
| 9 | */ |
| 10 | export interface GetWhatsAppFlowRequest extends Omit<socialmessaging.GetWhatsAppFlowInput, "id"> {} |
| 11 | |
| 12 | /** |
| 13 | * Runtime binding for `social-messaging:GetWhatsAppFlow`. |
| 14 | * |
| 15 | * Retrieves a WhatsApp Flow's details — status, categories, validation |
| 16 | * errors, health status — from the bound account. |
| 17 | * |
| 18 | * The deploy-time half grants `social-messaging:GetWhatsAppFlow` on the |
| 19 | * bound WABA's ARN and the runtime half injects the linked account id |
| 20 | * into every request. |
| 21 | * Provide the implementation with |
| 22 | * `Effect.provide(AWS.SocialMessaging.GetWhatsAppFlowHttp)`. |
| 23 | * ### Managing WhatsApp Flows |
| 24 | * **Example:** Read a Flow |
| 25 | * ```typescript |
| 26 | * // init — bind the operation to the linked WABA |
| 27 | * const getFlow = yield* AWS.SocialMessaging.GetWhatsAppFlow(account); |
| 28 | * |
| 29 | * // runtime |
| 30 | * const flow = yield* getFlow({ flowId: "1234567890" }); |
| 31 | * const publishable = flow.validationErrors?.length === 0; |
| 32 | * ``` |
| 33 | * |
| 34 | * @binding |
| 35 | */ |
| 36 | export interface GetWhatsAppFlow extends Binding.Service< |
| 37 | GetWhatsAppFlow, |
| 38 | "AWS.SocialMessaging.GetWhatsAppFlow", |
| 39 | ( |
| 40 | account: LinkedWhatsAppBusinessAccount, |
| 41 | ) => Effect.Effect< |
| 42 | ( |
| 43 | request: GetWhatsAppFlowRequest, |
| 44 | ) => Effect.Effect<socialmessaging.GetWhatsAppFlowOutput, socialmessaging.GetWhatsAppFlowError> |
| 45 | > |
| 46 | > {} |
| 47 | export const GetWhatsAppFlow = Binding.Service<GetWhatsAppFlow>( |
| 48 | "AWS.SocialMessaging.GetWhatsAppFlow", |
| 49 | ); |