| 1 | import type * as contacts from "@distilled.cloud/aws/notificationscontacts"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { EmailContact } from "./EmailContact.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for `notifications-contacts:SendActivationCode`. |
| 8 | * |
| 9 | * Send (or re-send) the activation email to the bound contact's address. |
| 10 | * The email contains the activation code the address owner uses to confirm |
| 11 | * the contact (directly via the emailed link, or through your app via |
| 12 | * {@link ActivateEmailContact}). Provide the implementation with |
| 13 | * `Effect.provide(AWS.NotificationsContacts.SendActivationCodeHttp)`. |
| 14 | * ### Activating a Contact |
| 15 | * **Example:** Re-send the Activation Email |
| 16 | * ```typescript |
| 17 | * // init — bind the operation to the contact |
| 18 | * const sendActivationCode = |
| 19 | * yield* AWS.NotificationsContacts.SendActivationCode(contact); |
| 20 | * |
| 21 | * // runtime — e.g. behind a "resend confirmation email" button |
| 22 | * yield* sendActivationCode(); |
| 23 | * ``` |
| 24 | * |
| 25 | * @binding |
| 26 | */ |
| 27 | export interface SendActivationCode extends Binding.Service< |
| 28 | SendActivationCode, |
| 29 | "AWS.NotificationsContacts.SendActivationCode", |
| 30 | ( |
| 31 | contact: EmailContact, |
| 32 | ) => Effect.Effect< |
| 33 | () => Effect.Effect< |
| 34 | contacts.SendActivationCodeResponse, |
| 35 | contacts.SendActivationCodeError |
| 36 | > |
| 37 | > |
| 38 | > {} |
| 39 | |
| 40 | export const SendActivationCode = Binding.Service<SendActivationCode>( |
| 41 | "AWS.NotificationsContacts.SendActivationCode", |
| 42 | ); |