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	"time"
13)
14
15// Provides information about an import job.
16func (c *Client) GetImportJob(ctx context.Context, params *GetImportJobInput, optFns ...func(*Options)) (*GetImportJobOutput, error) {
17	if params == nil {
18		params = &GetImportJobInput{}
19	}
20
21	result, metadata, err := c.invokeOperation(ctx, "GetImportJob", params, optFns, addOperationGetImportJobMiddlewares)
22	if err != nil {
23		return nil, err
24	}
25
26	out := result.(*GetImportJobOutput)
27	out.ResultMetadata = metadata
28	return out, nil
29}
30
31// Represents a request for information about an import job using the import job
32// ID.
33type GetImportJobInput struct {
34
35	// The ID of the import job.
36	//
37	// This member is required.
38	JobId *string
39}
40
41// An HTTP 200 response if the request succeeds, or an error message if the request
42// fails.
43type GetImportJobOutput struct {
44
45	// The time stamp of when the import job was completed.
46	CompletedTimestamp *time.Time
47
48	// The time stamp of when the import job was created.
49	CreatedTimestamp *time.Time
50
51	// The number of records that failed processing because of invalid input or other
52	// reasons.
53	FailedRecordsCount *int32
54
55	// The failure details about an import job.
56	FailureInfo *types.FailureInfo
57
58	// The data source of the import job.
59	ImportDataSource *types.ImportDataSource
60
61	// The destination of the import job.
62	ImportDestination *types.ImportDestination
63
64	// A string that represents the import job ID.
65	JobId *string
66
67	// The status of the import job.
68	JobStatus types.JobStatus
69
70	// The current number of records processed.
71	ProcessedRecordsCount *int32
72
73	// Metadata pertaining to the operation's result.
74	ResultMetadata middleware.Metadata
75}
76
77func addOperationGetImportJobMiddlewares(stack *middleware.Stack, options Options) (err error) {
78	err = stack.Serialize.Add(&awsRestjson1_serializeOpGetImportJob{}, middleware.After)
79	if err != nil {
80		return err
81	}
82	err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetImportJob{}, middleware.After)
83	if err != nil {
84		return err
85	}
86	if err = addSetLoggerMiddleware(stack, options); err != nil {
87		return err
88	}
89	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
90		return err
91	}
92	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
93		return err
94	}
95	if err = addResolveEndpointMiddleware(stack, options); err != nil {
96		return err
97	}
98	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
99		return err
100	}
101	if err = addRetryMiddlewares(stack, options); err != nil {
102		return err
103	}
104	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
105		return err
106	}
107	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
108		return err
109	}
110	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
111		return err
112	}
113	if err = addClientUserAgent(stack); err != nil {
114		return err
115	}
116	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
117		return err
118	}
119	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
120		return err
121	}
122	if err = addOpGetImportJobValidationMiddleware(stack); err != nil {
123		return err
124	}
125	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetImportJob(options.Region), middleware.Before); err != nil {
126		return err
127	}
128	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
129		return err
130	}
131	if err = addResponseErrorMiddleware(stack); err != nil {
132		return err
133	}
134	if err = addRequestResponseLogging(stack, options); err != nil {
135		return err
136	}
137	return nil
138}
139
140func newServiceMetadataMiddleware_opGetImportJob(region string) *awsmiddleware.RegisterServiceMetadata {
141	return &awsmiddleware.RegisterServiceMetadata{
142		Region:        region,
143		ServiceID:     ServiceID,
144		SigningName:   "ses",
145		OperationName: "GetImportJob",
146	}
147}
148