| 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 ListWhatsAppFlows}. The linked WABA `id` is injected by |
| 8 | * the binding from the bound {@link LinkedWhatsAppBusinessAccount}. |
| 9 | */ |
| 10 | export interface ListWhatsAppFlowsRequest extends Omit< |
| 11 | socialmessaging.ListWhatsAppFlowsInput, |
| 12 | "id" |
| 13 | > {} |
| 14 | |
| 15 | /** |
| 16 | * Runtime binding for `social-messaging:ListWhatsAppFlows`. |
| 17 | * |
| 18 | * Lists the WhatsApp Flows of the bound account with their status and |
| 19 | * validation errors. |
| 20 | * |
| 21 | * The deploy-time half grants `social-messaging:ListWhatsAppFlows` on the |
| 22 | * bound WABA's ARN and the runtime half injects the linked account id |
| 23 | * into every request. |
| 24 | * Provide the implementation with |
| 25 | * `Effect.provide(AWS.SocialMessaging.ListWhatsAppFlowsHttp)`. |
| 26 | * ### Managing WhatsApp Flows |
| 27 | * **Example:** List Flows |
| 28 | * ```typescript |
| 29 | * // init — bind the operation to the linked WABA |
| 30 | * const listFlows = yield* AWS.SocialMessaging.ListWhatsAppFlows(account); |
| 31 | * |
| 32 | * // runtime |
| 33 | * const { flows } = yield* listFlows({ maxResults: 25 }); |
| 34 | * ``` |
| 35 | * |
| 36 | * @binding |
| 37 | */ |
| 38 | export interface ListWhatsAppFlows extends Binding.Service< |
| 39 | ListWhatsAppFlows, |
| 40 | "AWS.SocialMessaging.ListWhatsAppFlows", |
| 41 | ( |
| 42 | account: LinkedWhatsAppBusinessAccount, |
| 43 | ) => Effect.Effect< |
| 44 | ( |
| 45 | request?: ListWhatsAppFlowsRequest, |
| 46 | ) => Effect.Effect< |
| 47 | socialmessaging.ListWhatsAppFlowsOutput, |
| 48 | socialmessaging.ListWhatsAppFlowsError |
| 49 | > |
| 50 | > |
| 51 | > {} |
| 52 | export const ListWhatsAppFlows = Binding.Service<ListWhatsAppFlows>( |
| 53 | "AWS.SocialMessaging.ListWhatsAppFlows", |
| 54 | ); |