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 CreateWhatsAppMessageTemplateFromLibrary}. The linked WABA `id` is injected by
8 * the binding from the bound {@link LinkedWhatsAppBusinessAccount}.
9 */
10export interface CreateWhatsAppMessageTemplateFromLibraryRequest extends Omit<
11 socialmessaging.CreateWhatsAppMessageTemplateFromLibraryInput,
12 "id"
13> {}
14
15/**
16 * Runtime binding for `social-messaging:CreateWhatsAppMessageTemplateFromLibrary`.
17 *
18 * Creates a WhatsApp message template on the bound account from one of the
19 * pre-approved templates in Meta's template library.
20 *
21 * The deploy-time half grants `social-messaging:CreateWhatsAppMessageTemplateFromLibrary` 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.CreateWhatsAppMessageTemplateFromLibraryHttp)`.
26 * ### Managing Message Templates
27 * **Example:** Create a Template from Meta's Library
28 * ```typescript
29 * // init — bind the operation to the linked WABA
30 * const createFromLibrary = yield* AWS.SocialMessaging.CreateWhatsAppMessageTemplateFromLibrary(account);
31 *
32 * // runtime
33 * const { metaTemplateId } = yield* createFromLibrary({
34 * metaLibraryTemplate: {
35 * templateName: "order_shipped",
36 * libraryTemplateName: "shipment_confirmation",
37 * templateCategory: "UTILITY",
38 * templateLanguage: "en_US",
39 * },
40 * });
41 * ```
42 *
43 * @binding
44 */
45export interface CreateWhatsAppMessageTemplateFromLibrary extends Binding.Service<
46 CreateWhatsAppMessageTemplateFromLibrary,
47 "AWS.SocialMessaging.CreateWhatsAppMessageTemplateFromLibrary",
48 (
49 account: LinkedWhatsAppBusinessAccount,
50 ) => Effect.Effect<
51 (
52 request: CreateWhatsAppMessageTemplateFromLibraryRequest,
53 ) => Effect.Effect<
54 socialmessaging.CreateWhatsAppMessageTemplateFromLibraryOutput,
55 socialmessaging.CreateWhatsAppMessageTemplateFromLibraryError
56 >
57 >
58> {}
59export const CreateWhatsAppMessageTemplateFromLibrary =
60 Binding.Service<CreateWhatsAppMessageTemplateFromLibrary>(
61 "AWS.SocialMessaging.CreateWhatsAppMessageTemplateFromLibrary",
62 );