@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 04:45 UTC

main
ts 64 lines 2.28 KB
Raw
1 import type * as socialmessaging from "@distilled.cloud/aws/socialmessaging";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { LinkedWhatsAppBusinessAccount } from "./LinkedWhatsAppBusinessAccount.ts";
5
6 /**
7 * Request for {@link CreateWhatsAppMessageTemplate}. The linked WABA `id` is injected by
8 * the binding from the bound {@link LinkedWhatsAppBusinessAccount}.
9 */
10 export interface CreateWhatsAppMessageTemplateRequest extends Omit<
11 socialmessaging.CreateWhatsAppMessageTemplateInput,
12 "id"
13 > {}
14
15 /**
16 * Runtime binding for `social-messaging:CreateWhatsAppMessageTemplate`.
17 *
18 * Creates a WhatsApp message template on the bound account from a raw Meta
19 * template-definition JSON blob. Templates must be approved by Meta before
20 * they can be sent.
21 *
22 * The deploy-time half grants `social-messaging:CreateWhatsAppMessageTemplate` on the
23 * bound WABA's ARN and the runtime half injects the linked account id
24 * into every request.
25 * Provide the implementation with
26 * `Effect.provide(AWS.SocialMessaging.CreateWhatsAppMessageTemplateHttp)`.
27 * ### Managing Message Templates
28 * **Example:** Create a Template from a Definition
29 * ```typescript
30 * // init — bind the operation to the linked WABA
31 * const createTemplate = yield* AWS.SocialMessaging.CreateWhatsAppMessageTemplate(account);
32 *
33 * // runtime
34 * const { metaTemplateId, templateStatus } = yield* createTemplate({
35 * templateDefinition: new TextEncoder().encode(
36 * JSON.stringify({
37 * name: "order_update",
38 * language: "en_US",
39 * category: "UTILITY",
40 * components: [{ type: "BODY", text: "Your order {{1}} shipped." }],
41 * }),
42 * ),
43 * });
44 * ```
45 *
46 * @binding
47 */
48 export interface CreateWhatsAppMessageTemplate extends Binding.Service<
49 CreateWhatsAppMessageTemplate,
50 "AWS.SocialMessaging.CreateWhatsAppMessageTemplate",
51 (
52 account: LinkedWhatsAppBusinessAccount,
53 ) => Effect.Effect<
54 (
55 request: CreateWhatsAppMessageTemplateRequest,
56 ) => Effect.Effect<
57 socialmessaging.CreateWhatsAppMessageTemplateOutput,
58 socialmessaging.CreateWhatsAppMessageTemplateError
59 >
60 >
61 > {}
62 export const CreateWhatsAppMessageTemplate = Binding.Service<CreateWhatsAppMessageTemplate>(
63 "AWS.SocialMessaging.CreateWhatsAppMessageTemplate",
64 );