1// Code generated by smithy-go-codegen DO NOT EDIT.
2
3package sesv2
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/aws-sdk-go-v2/service/sesv2/types"
10	"github.com/aws/smithy-go/middleware"
11	smithyhttp "github.com/aws/smithy-go/transport/http"
12)
13
14// Provides information about a specific identity, including the identity's
15// verification status, sending authorization policies, its DKIM authentication
16// status, and its custom Mail-From settings.
17func (c *Client) GetEmailIdentity(ctx context.Context, params *GetEmailIdentityInput, optFns ...func(*Options)) (*GetEmailIdentityOutput, error) {
18	if params == nil {
19		params = &GetEmailIdentityInput{}
20	}
21
22	result, metadata, err := c.invokeOperation(ctx, "GetEmailIdentity", params, optFns, addOperationGetEmailIdentityMiddlewares)
23	if err != nil {
24		return nil, err
25	}
26
27	out := result.(*GetEmailIdentityOutput)
28	out.ResultMetadata = metadata
29	return out, nil
30}
31
32// A request to return details about an email identity.
33type GetEmailIdentityInput struct {
34
35	// The email identity that you want to retrieve details for.
36	//
37	// This member is required.
38	EmailIdentity *string
39}
40
41// Details about an email identity.
42type GetEmailIdentityOutput struct {
43
44	// An object that contains information about the DKIM attributes for the identity.
45	DkimAttributes *types.DkimAttributes
46
47	// The feedback forwarding configuration for the identity. If the value is true,
48	// you receive email notifications when bounce or complaint events occur. These
49	// notifications are sent to the address that you specified in the Return-Path
50	// header of the original email. You're required to have a method of tracking
51	// bounces and complaints. If you haven't set up another mechanism for receiving
52	// bounce or complaint notifications (for example, by setting up an event
53	// destination), you receive an email notification when these events occur (even if
54	// this setting is disabled).
55	FeedbackForwardingStatus bool
56
57	// The email identity type.
58	IdentityType types.IdentityType
59
60	// An object that contains information about the Mail-From attributes for the email
61	// identity.
62	MailFromAttributes *types.MailFromAttributes
63
64	// A map of policy names to policies.
65	Policies map[string]string
66
67	// An array of objects that define the tags (keys and values) that are associated
68	// with the email identity.
69	Tags []types.Tag
70
71	// Specifies whether or not the identity is verified. You can only send email from
72	// verified email addresses or domains. For more information about verifying
73	// identities, see the Amazon Pinpoint User Guide
74	// (https://docs.aws.amazon.com/pinpoint/latest/userguide/channels-email-manage-verify.html).
75	VerifiedForSendingStatus bool
76
77	// Metadata pertaining to the operation's result.
78	ResultMetadata middleware.Metadata
79}
80
81func addOperationGetEmailIdentityMiddlewares(stack *middleware.Stack, options Options) (err error) {
82	err = stack.Serialize.Add(&awsRestjson1_serializeOpGetEmailIdentity{}, middleware.After)
83	if err != nil {
84		return err
85	}
86	err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetEmailIdentity{}, middleware.After)
87	if err != nil {
88		return err
89	}
90	if err = addSetLoggerMiddleware(stack, options); err != nil {
91		return err
92	}
93	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
94		return err
95	}
96	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
97		return err
98	}
99	if err = addResolveEndpointMiddleware(stack, options); err != nil {
100		return err
101	}
102	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
103		return err
104	}
105	if err = addRetryMiddlewares(stack, options); err != nil {
106		return err
107	}
108	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
109		return err
110	}
111	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
112		return err
113	}
114	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
115		return err
116	}
117	if err = addClientUserAgent(stack); err != nil {
118		return err
119	}
120	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
121		return err
122	}
123	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
124		return err
125	}
126	if err = addOpGetEmailIdentityValidationMiddleware(stack); err != nil {
127		return err
128	}
129	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetEmailIdentity(options.Region), middleware.Before); err != nil {
130		return err
131	}
132	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
133		return err
134	}
135	if err = addResponseErrorMiddleware(stack); err != nil {
136		return err
137	}
138	if err = addRequestResponseLogging(stack, options); err != nil {
139		return err
140	}
141	return nil
142}
143
144func newServiceMetadataMiddleware_opGetEmailIdentity(region string) *awsmiddleware.RegisterServiceMetadata {
145	return &awsmiddleware.RegisterServiceMetadata{
146		Region:        region,
147		ServiceID:     ServiceID,
148		SigningName:   "ses",
149		OperationName: "GetEmailIdentity",
150	}
151}
152