1// Code generated by smithy-go-codegen DO NOT EDIT.
2
3package eventbridge
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/eventbridge/types"
10	"github.com/aws/smithy-go/middleware"
11	smithyhttp "github.com/aws/smithy-go/transport/http"
12	"time"
13)
14
15// Retrieves details about a replay. Use DescribeReplay to determine the progress
16// of a running replay. A replay processes events to replay based on the time in
17// the event, and replays them using 1 minute intervals. If you use StartReplay and
18// specify an EventStartTime and an EventEndTime that covers a 20 minute time
19// range, the events are replayed from the first minute of that 20 minute range
20// first. Then the events from the second minute are replayed. You can use
21// DescribeReplay to determine the progress of a replay. The value returned for
22// EventLastReplayedTime indicates the time within the specified time range
23// associated with the last event replayed.
24func (c *Client) DescribeReplay(ctx context.Context, params *DescribeReplayInput, optFns ...func(*Options)) (*DescribeReplayOutput, error) {
25	if params == nil {
26		params = &DescribeReplayInput{}
27	}
28
29	result, metadata, err := c.invokeOperation(ctx, "DescribeReplay", params, optFns, c.addOperationDescribeReplayMiddlewares)
30	if err != nil {
31		return nil, err
32	}
33
34	out := result.(*DescribeReplayOutput)
35	out.ResultMetadata = metadata
36	return out, nil
37}
38
39type DescribeReplayInput struct {
40
41	// The name of the replay to retrieve.
42	//
43	// This member is required.
44	ReplayName *string
45
46	noSmithyDocumentSerde
47}
48
49type DescribeReplayOutput struct {
50
51	// The description of the replay.
52	Description *string
53
54	// A ReplayDestination object that contains details about the replay.
55	Destination *types.ReplayDestination
56
57	// The time stamp for the last event that was replayed from the archive.
58	EventEndTime *time.Time
59
60	// The time that the event was last replayed.
61	EventLastReplayedTime *time.Time
62
63	// The ARN of the archive events were replayed from.
64	EventSourceArn *string
65
66	// The time stamp of the first event that was last replayed from the archive.
67	EventStartTime *time.Time
68
69	// The ARN of the replay.
70	ReplayArn *string
71
72	// A time stamp for the time that the replay stopped.
73	ReplayEndTime *time.Time
74
75	// The name of the replay.
76	ReplayName *string
77
78	// A time stamp for the time that the replay started.
79	ReplayStartTime *time.Time
80
81	// The current state of the replay.
82	State types.ReplayState
83
84	// The reason that the replay is in the current state.
85	StateReason *string
86
87	// Metadata pertaining to the operation's result.
88	ResultMetadata middleware.Metadata
89
90	noSmithyDocumentSerde
91}
92
93func (c *Client) addOperationDescribeReplayMiddlewares(stack *middleware.Stack, options Options) (err error) {
94	err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeReplay{}, middleware.After)
95	if err != nil {
96		return err
97	}
98	err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeReplay{}, middleware.After)
99	if err != nil {
100		return err
101	}
102	if err = addSetLoggerMiddleware(stack, options); err != nil {
103		return err
104	}
105	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
106		return err
107	}
108	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
109		return err
110	}
111	if err = addResolveEndpointMiddleware(stack, options); err != nil {
112		return err
113	}
114	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
115		return err
116	}
117	if err = addRetryMiddlewares(stack, options); err != nil {
118		return err
119	}
120	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
121		return err
122	}
123	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
124		return err
125	}
126	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
127		return err
128	}
129	if err = addClientUserAgent(stack); err != nil {
130		return err
131	}
132	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
133		return err
134	}
135	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
136		return err
137	}
138	if err = addOpDescribeReplayValidationMiddleware(stack); err != nil {
139		return err
140	}
141	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeReplay(options.Region), middleware.Before); err != nil {
142		return err
143	}
144	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
145		return err
146	}
147	if err = addResponseErrorMiddleware(stack); err != nil {
148		return err
149	}
150	if err = addRequestResponseLogging(stack, options); err != nil {
151		return err
152	}
153	return nil
154}
155
156func newServiceMetadataMiddleware_opDescribeReplay(region string) *awsmiddleware.RegisterServiceMetadata {
157	return &awsmiddleware.RegisterServiceMetadata{
158		Region:        region,
159		ServiceID:     ServiceID,
160		SigningName:   "events",
161		OperationName: "DescribeReplay",
162	}
163}
164