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	// The configuration set used by default when sending from this identity.
45	ConfigurationSetName *string
46
47	// An object that contains information about the DKIM attributes for the identity.
48	DkimAttributes *types.DkimAttributes
49
50	// The feedback forwarding configuration for the identity. If the value is true,
51	// you receive email notifications when bounce or complaint events occur. These
52	// notifications are sent to the address that you specified in the Return-Path
53	// header of the original email. You're required to have a method of tracking
54	// bounces and complaints. If you haven't set up another mechanism for receiving
55	// bounce or complaint notifications (for example, by setting up an event
56	// destination), you receive an email notification when these events occur (even if
57	// this setting is disabled).
58	FeedbackForwardingStatus bool
59
60	// The email identity type.
61	IdentityType types.IdentityType
62
63	// An object that contains information about the Mail-From attributes for the email
64	// identity.
65	MailFromAttributes *types.MailFromAttributes
66
67	// A map of policy names to policies.
68	Policies map[string]string
69
70	// An array of objects that define the tags (keys and values) that are associated
71	// with the email identity.
72	Tags []types.Tag
73
74	// Specifies whether or not the identity is verified. You can only send email from
75	// verified email addresses or domains. For more information about verifying
76	// identities, see the Amazon Pinpoint User Guide
77	// (https://docs.aws.amazon.com/pinpoint/latest/userguide/channels-email-manage-verify.html).
78	VerifiedForSendingStatus bool
79
80	// Metadata pertaining to the operation's result.
81	ResultMetadata middleware.Metadata
82}
83
84func addOperationGetEmailIdentityMiddlewares(stack *middleware.Stack, options Options) (err error) {
85	err = stack.Serialize.Add(&awsRestjson1_serializeOpGetEmailIdentity{}, middleware.After)
86	if err != nil {
87		return err
88	}
89	err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetEmailIdentity{}, middleware.After)
90	if err != nil {
91		return err
92	}
93	if err = addSetLoggerMiddleware(stack, options); err != nil {
94		return err
95	}
96	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
97		return err
98	}
99	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
100		return err
101	}
102	if err = addResolveEndpointMiddleware(stack, options); err != nil {
103		return err
104	}
105	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
106		return err
107	}
108	if err = addRetryMiddlewares(stack, options); err != nil {
109		return err
110	}
111	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
112		return err
113	}
114	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
115		return err
116	}
117	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
118		return err
119	}
120	if err = addClientUserAgent(stack); err != nil {
121		return err
122	}
123	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
124		return err
125	}
126	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
127		return err
128	}
129	if err = addOpGetEmailIdentityValidationMiddleware(stack); err != nil {
130		return err
131	}
132	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetEmailIdentity(options.Region), middleware.Before); err != nil {
133		return err
134	}
135	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
136		return err
137	}
138	if err = addResponseErrorMiddleware(stack); err != nil {
139		return err
140	}
141	if err = addRequestResponseLogging(stack, options); err != nil {
142		return err
143	}
144	return nil
145}
146
147func newServiceMetadataMiddleware_opGetEmailIdentity(region string) *awsmiddleware.RegisterServiceMetadata {
148	return &awsmiddleware.RegisterServiceMetadata{
149		Region:        region,
150		ServiceID:     ServiceID,
151		SigningName:   "ses",
152		OperationName: "GetEmailIdentity",
153	}
154}
155