| 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 | * Request for {@link ActivateEmailContact} — the bound contact's ARN is |
| 8 | * injected automatically. The activation `code` is the one AWS emailed to |
| 9 | * the contact's address (a one-time token — pass it as |
| 10 | * `Redacted.make(code)` to keep it out of logs). |
| 11 | */ |
| 12 | export interface ActivateEmailContactRequest extends Omit< |
| 13 | contacts.ActivateEmailContactRequest, |
| 14 | "arn" |
| 15 | > {} |
| 16 | |
| 17 | /** |
| 18 | * Runtime binding for `notifications-contacts:ActivateEmailContact`. |
| 19 | * |
| 20 | * Activate the bound email contact with the activation code the address |
| 21 | * owner received (see {@link SendActivationCode}) — e.g. from a |
| 22 | * confirmation form in your app. Provide the implementation with |
| 23 | * `Effect.provide(AWS.NotificationsContacts.ActivateEmailContactHttp)`. |
| 24 | * ### Activating a Contact |
| 25 | * **Example:** Activate with a User-Supplied Code |
| 26 | * ```typescript |
| 27 | * // init — bind the operation to the contact |
| 28 | * const activate = yield* AWS.NotificationsContacts.ActivateEmailContact(contact); |
| 29 | * |
| 30 | * // runtime — the user pasted the code from the activation email |
| 31 | * yield* activate({ code: Redacted.make(userSuppliedCode) }); |
| 32 | * ``` |
| 33 | * |
| 34 | * @binding |
| 35 | */ |
| 36 | export interface ActivateEmailContact extends Binding.Service< |
| 37 | ActivateEmailContact, |
| 38 | "AWS.NotificationsContacts.ActivateEmailContact", |
| 39 | ( |
| 40 | contact: EmailContact, |
| 41 | ) => Effect.Effect< |
| 42 | ( |
| 43 | request: ActivateEmailContactRequest, |
| 44 | ) => Effect.Effect< |
| 45 | contacts.ActivateEmailContactResponse, |
| 46 | contacts.ActivateEmailContactError |
| 47 | > |
| 48 | > |
| 49 | > {} |
| 50 | |
| 51 | export const ActivateEmailContact = Binding.Service<ActivateEmailContact>( |
| 52 | "AWS.NotificationsContacts.ActivateEmailContact", |
| 53 | ); |