1import type * as acm from "@distilled.cloud/aws/acm";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { Certificate } from "./Certificate.ts";
5
6/**
7 * The resend request without the injected `CertificateArn`.
8 */
9export interface ResendValidationEmailRequest extends Omit<
10 acm.ResendValidationEmailRequest,
11 "CertificateArn"
12> {}
13
14/**
15 * Runtime binding for `acm:ResendValidationEmail`.
16 *
17 * Bind this operation to a {@link Certificate} requested with
18 * `validationMethod: "EMAIL"` to get a callable that re-sends the domain
19 * ownership validation email — e.g. behind a "resend email" button in an
20 * onboarding flow. Calling it on a DNS-validated certificate fails with the
21 * typed `InvalidStateException`. Provide the implementation with
22 * `Effect.provide(AWS.ACM.ResendValidationEmailHttp)`.
23 * ### Validating Certificates
24 * **Example:** Re-send the Validation Email
25 * ```typescript
26 * // init — bind the operation to the certificate
27 * const resendValidationEmail =
28 * yield* AWS.ACM.ResendValidationEmail(certificate);
29 *
30 * // runtime
31 * yield* resendValidationEmail({
32 * Domain: "www.example.com",
33 * ValidationDomain: "example.com",
34 * });
35 * ```
36 *
37 * @binding
38 */
39export interface ResendValidationEmail extends Binding.Service<
40 ResendValidationEmail,
41 "AWS.ACM.ResendValidationEmail",
42 (
43 certificate: Certificate,
44 ) => Effect.Effect<
45 (
46 request: ResendValidationEmailRequest,
47 ) => Effect.Effect<
48 acm.ResendValidationEmailResponse,
49 acm.ResendValidationEmailError
50 >
51 >
52> {}
53
54export const ResendValidationEmail = Binding.Service<ResendValidationEmail>(
55 "AWS.ACM.ResendValidationEmail",
56);