| 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 | * Request for {@link UpdateWhatsAppFlow}. The linked WABA `id` is injected by |
| 8 | * the binding from the bound {@link LinkedWhatsAppBusinessAccount}. |
| 9 | */ |
| 10 | export interface UpdateWhatsAppFlowRequest extends Omit< |
| 11 | socialmessaging.UpdateWhatsAppFlowInput, |
| 12 | "id" |
| 13 | > {} |
| 14 | |
| 15 | /** |
| 16 | * Runtime binding for `social-messaging:UpdateWhatsAppFlow`. |
| 17 | * |
| 18 | * Updates a WhatsApp Flow's name and categories on the bound account. |
| 19 | * |
| 20 | * The deploy-time half grants `social-messaging:UpdateWhatsAppFlow` on the |
| 21 | * bound WABA's ARN and the runtime half injects the linked account id |
| 22 | * into every request. |
| 23 | * Provide the implementation with |
| 24 | * `Effect.provide(AWS.SocialMessaging.UpdateWhatsAppFlowHttp)`. |
| 25 | * ### Managing WhatsApp Flows |
| 26 | * **Example:** Rename a Flow |
| 27 | * ```typescript |
| 28 | * // init — bind the operation to the linked WABA |
| 29 | * const updateFlow = yield* AWS.SocialMessaging.UpdateWhatsAppFlow(account); |
| 30 | * |
| 31 | * // runtime |
| 32 | * yield* updateFlow({ |
| 33 | * flowId: "1234567890", |
| 34 | * flowName: "appointment-booking-v2", |
| 35 | * }); |
| 36 | * ``` |
| 37 | * |
| 38 | * @binding |
| 39 | */ |
| 40 | export interface UpdateWhatsAppFlow extends Binding.Service< |
| 41 | UpdateWhatsAppFlow, |
| 42 | "AWS.SocialMessaging.UpdateWhatsAppFlow", |
| 43 | ( |
| 44 | account: LinkedWhatsAppBusinessAccount, |
| 45 | ) => Effect.Effect< |
| 46 | ( |
| 47 | request: UpdateWhatsAppFlowRequest, |
| 48 | ) => Effect.Effect< |
| 49 | socialmessaging.UpdateWhatsAppFlowOutput, |
| 50 | socialmessaging.UpdateWhatsAppFlowError |
| 51 | > |
| 52 | > |
| 53 | > {} |
| 54 | export const UpdateWhatsAppFlow = Binding.Service<UpdateWhatsAppFlow>( |
| 55 | "AWS.SocialMessaging.UpdateWhatsAppFlow", |
| 56 | ); |