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 ListWhatsAppTemplateLibrary}. The linked WABA `id` is injected by
8 * the binding from the bound {@link LinkedWhatsAppBusinessAccount}.
9 */
10export interface ListWhatsAppTemplateLibraryRequest extends Omit<
11 socialmessaging.ListWhatsAppTemplateLibraryInput,
12 "id"
13> {}
14
15/**
16 * Runtime binding for `social-messaging:ListWhatsAppTemplateLibrary`.
17 *
18 * Lists the pre-approved templates available in Meta's template library,
19 * optionally filtered by category, topic, or industry.
20 *
21 * The deploy-time half grants `social-messaging:ListWhatsAppTemplateLibrary` 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.ListWhatsAppTemplateLibraryHttp)`.
26 * ### Managing Message Templates
27 * **Example:** Browse Meta's Template Library
28 * ```typescript
29 * // init — bind the operation to the linked WABA
30 * const browseLibrary = yield* AWS.SocialMessaging.ListWhatsAppTemplateLibrary(account);
31 *
32 * // runtime
33 * const { metaLibraryTemplates } = yield* browseLibrary({
34 * filters: { category: "UTILITY" },
35 * });
36 * ```
37 *
38 * @binding
39 */
40export interface ListWhatsAppTemplateLibrary extends Binding.Service<
41 ListWhatsAppTemplateLibrary,
42 "AWS.SocialMessaging.ListWhatsAppTemplateLibrary",
43 (
44 account: LinkedWhatsAppBusinessAccount,
45 ) => Effect.Effect<
46 (
47 request?: ListWhatsAppTemplateLibraryRequest,
48 ) => Effect.Effect<
49 socialmessaging.ListWhatsAppTemplateLibraryOutput,
50 socialmessaging.ListWhatsAppTemplateLibraryError
51 >
52 >
53> {}
54export const ListWhatsAppTemplateLibrary =
55 Binding.Service<ListWhatsAppTemplateLibrary>(
56 "AWS.SocialMessaging.ListWhatsAppTemplateLibrary",
57 );