1// Code generated by smithy-go-codegen DO NOT EDIT.
2
3package acm
4
5import (
6	"context"
7	awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
8	"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
9	"github.com/aws/smithy-go/middleware"
10	smithyhttp "github.com/aws/smithy-go/transport/http"
11)
12
13// Resends the email that requests domain ownership validation. The domain owner or
14// an authorized representative must approve the ACM certificate before it can be
15// issued. The certificate can be approved by clicking a link in the mail to
16// navigate to the Amazon certificate approval website and then clicking I Approve.
17// However, the validation email can be blocked by spam filters. Therefore, if you
18// do not receive the original mail, you can request that the mail be resent within
19// 72 hours of requesting the ACM certificate. If more than 72 hours have elapsed
20// since your original request or since your last attempt to resend validation
21// mail, you must request a new certificate. For more information about setting up
22// your contact email addresses, see Configure Email for your Domain
23// (https://docs.aws.amazon.com/acm/latest/userguide/setup-email.html).
24func (c *Client) ResendValidationEmail(ctx context.Context, params *ResendValidationEmailInput, optFns ...func(*Options)) (*ResendValidationEmailOutput, error) {
25	if params == nil {
26		params = &ResendValidationEmailInput{}
27	}
28
29	result, metadata, err := c.invokeOperation(ctx, "ResendValidationEmail", params, optFns, addOperationResendValidationEmailMiddlewares)
30	if err != nil {
31		return nil, err
32	}
33
34	out := result.(*ResendValidationEmailOutput)
35	out.ResultMetadata = metadata
36	return out, nil
37}
38
39type ResendValidationEmailInput struct {
40
41	// String that contains the ARN of the requested certificate. The certificate ARN
42	// is generated and returned by the RequestCertificate action as soon as the
43	// request is made. By default, using this parameter causes email to be sent to all
44	// top-level domains you specified in the certificate request. The ARN must be of
45	// the form:
46	// arn:aws:acm:us-east-1:123456789012:certificate/12345678-1234-1234-1234-123456789012
47	//
48	// This member is required.
49	CertificateArn *string
50
51	// The fully qualified domain name (FQDN) of the certificate that needs to be
52	// validated.
53	//
54	// This member is required.
55	Domain *string
56
57	// The base validation domain that will act as the suffix of the email addresses
58	// that are used to send the emails. This must be the same as the Domain value or a
59	// superdomain of the Domain value. For example, if you requested a certificate for
60	// site.subdomain.example.com and specify a ValidationDomain of
61	// subdomain.example.com, ACM sends email to the domain registrant, technical
62	// contact, and administrative contact in WHOIS and the following five
63	// addresses:
64	//
65	// * admin@subdomain.example.com
66	//
67	// *
68	// administrator@subdomain.example.com
69	//
70	// * hostmaster@subdomain.example.com
71	//
72	// *
73	// postmaster@subdomain.example.com
74	//
75	// * webmaster@subdomain.example.com
76	//
77	// This member is required.
78	ValidationDomain *string
79}
80
81type ResendValidationEmailOutput struct {
82	// Metadata pertaining to the operation's result.
83	ResultMetadata middleware.Metadata
84}
85
86func addOperationResendValidationEmailMiddlewares(stack *middleware.Stack, options Options) (err error) {
87	err = stack.Serialize.Add(&awsAwsjson11_serializeOpResendValidationEmail{}, middleware.After)
88	if err != nil {
89		return err
90	}
91	err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpResendValidationEmail{}, middleware.After)
92	if err != nil {
93		return err
94	}
95	if err = addSetLoggerMiddleware(stack, options); err != nil {
96		return err
97	}
98	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
99		return err
100	}
101	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
102		return err
103	}
104	if err = addResolveEndpointMiddleware(stack, options); err != nil {
105		return err
106	}
107	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
108		return err
109	}
110	if err = addRetryMiddlewares(stack, options); err != nil {
111		return err
112	}
113	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
114		return err
115	}
116	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
117		return err
118	}
119	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
120		return err
121	}
122	if err = addClientUserAgent(stack); err != nil {
123		return err
124	}
125	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
126		return err
127	}
128	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
129		return err
130	}
131	if err = addOpResendValidationEmailValidationMiddleware(stack); err != nil {
132		return err
133	}
134	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opResendValidationEmail(options.Region), middleware.Before); err != nil {
135		return err
136	}
137	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
138		return err
139	}
140	if err = addResponseErrorMiddleware(stack); err != nil {
141		return err
142	}
143	if err = addRequestResponseLogging(stack, options); err != nil {
144		return err
145	}
146	return nil
147}
148
149func newServiceMetadataMiddleware_opResendValidationEmail(region string) *awsmiddleware.RegisterServiceMetadata {
150	return &awsmiddleware.RegisterServiceMetadata{
151		Region:        region,
152		ServiceID:     ServiceID,
153		SigningName:   "acm",
154		OperationName: "ResendValidationEmail",
155	}
156}
157