sailfork / t3code-github / .repos/ alchemy-effect/ packages/ aws/ src/ SocialMessaging/ DeleteWhatsAppMessageTemplate.ts

import type * as socialmessaging from "@distilled.cloud/aws/socialmessaging";
import * as Binding from "alchemy/Binding";
import type * as Effect from "effect/Effect";
import type { LinkedWhatsAppBusinessAccount } from "./LinkedWhatsAppBusinessAccount.ts";

/**
 * Request for {@link DeleteWhatsAppMessageTemplate}. The linked WABA `id` is injected by
 * the binding from the bound {@link LinkedWhatsAppBusinessAccount}.
 */
export interface DeleteWhatsAppMessageTemplateRequest extends Omit<
  socialmessaging.DeleteWhatsAppMessageTemplateInput,
  "id"
> {}

/**
 * Runtime binding for `social-messaging:DeleteWhatsAppMessageTemplate`.
 *
 * Deletes a WhatsApp message template from the bound account, optionally
 * across all of its languages.
 *
 * The deploy-time half grants `social-messaging:DeleteWhatsAppMessageTemplate` on the
 * bound WABA's ARN and the runtime half injects the linked account id
 * into every request.
 * Provide the implementation with
 * `Effect.provide(AWS.SocialMessaging.DeleteWhatsAppMessageTemplateHttp)`.
 * ### Managing Message Templates
 * **Example:** Delete a Template
 * ```typescript
 * // init — bind the operation to the linked WABA
 * const deleteTemplate = yield* AWS.SocialMessaging.DeleteWhatsAppMessageTemplate(account);
 *
 * // runtime
 * yield* deleteTemplate({
 *   templateName: "order_update",
 *   deleteAllLanguages: true,
 * });
 * ```
 *
 * @binding
 */
export interface DeleteWhatsAppMessageTemplate extends Binding.Service<
  DeleteWhatsAppMessageTemplate,
  "AWS.SocialMessaging.DeleteWhatsAppMessageTemplate",
  (
    account: LinkedWhatsAppBusinessAccount,
  ) => Effect.Effect<
    (
      request: DeleteWhatsAppMessageTemplateRequest,
    ) => Effect.Effect<
      socialmessaging.DeleteWhatsAppMessageTemplateOutput,
      socialmessaging.DeleteWhatsAppMessageTemplateError
    >
  >
> {}
export const DeleteWhatsAppMessageTemplate = Binding.Service<DeleteWhatsAppMessageTemplate>(
  "AWS.SocialMessaging.DeleteWhatsAppMessageTemplate",
);