1import type * as socialmessaging from "@distilled.cloud/aws/socialmessaging";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { LinkedWhatsAppBusinessAccount } from "./LinkedWhatsAppBusinessAccount.ts";
5
6/**
7 * Request for {@link GetWhatsAppFlowPreview}. The linked WABA `id` is injected by
8 * the binding from the bound {@link LinkedWhatsAppBusinessAccount}.
9 */
10export interface GetWhatsAppFlowPreviewRequest extends Omit<
11 socialmessaging.GetWhatsAppFlowPreviewInput,
12 "id"
13> {}
14
15/**
16 * Runtime binding for `social-messaging:GetWhatsAppFlowPreview`.
17 *
18 * Generates (or refreshes with `invalidate`) a shareable preview URL for a
19 * WhatsApp Flow on the bound account.
20 *
21 * The deploy-time half grants `social-messaging:GetWhatsAppFlowPreview` 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.GetWhatsAppFlowPreviewHttp)`.
26 * ### Managing WhatsApp Flows
27 * **Example:** Get a Flow Preview URL
28 * ```typescript
29 * // init — bind the operation to the linked WABA
30 * const getFlowPreview = yield* AWS.SocialMessaging.GetWhatsAppFlowPreview(account);
31 *
32 * // runtime
33 * const { preview } = yield* getFlowPreview({
34 * flowId: "1234567890",
35 * invalidate: true,
36 * });
37 * ```
38 *
39 * @binding
40 */
41export interface GetWhatsAppFlowPreview extends Binding.Service<
42 GetWhatsAppFlowPreview,
43 "AWS.SocialMessaging.GetWhatsAppFlowPreview",
44 (
45 account: LinkedWhatsAppBusinessAccount,
46 ) => Effect.Effect<
47 (
48 request: GetWhatsAppFlowPreviewRequest,
49 ) => Effect.Effect<
50 socialmessaging.GetWhatsAppFlowPreviewOutput,
51 socialmessaging.GetWhatsAppFlowPreviewError
52 >
53 >
54> {}
55export const GetWhatsAppFlowPreview = Binding.Service<GetWhatsAppFlowPreview>(
56 "AWS.SocialMessaging.GetWhatsAppFlowPreview",
57);