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, 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
47type DescribeReplayOutput struct {
48
49	// The description of the replay.
50	Description *string
51
52	// A ReplayDestination object that contains details about the replay.
53	Destination *types.ReplayDestination
54
55	// The time stamp for the last event that was replayed from the archive.
56	EventEndTime *time.Time
57
58	// The time that the event was last replayed.
59	EventLastReplayedTime *time.Time
60
61	// The ARN of the archive events were replayed from.
62	EventSourceArn *string
63
64	// The time stamp of the first event that was last replayed from the archive.
65	EventStartTime *time.Time
66
67	// The ARN of the replay.
68	ReplayArn *string
69
70	// A time stamp for the time that the replay stopped.
71	ReplayEndTime *time.Time
72
73	// The name of the replay.
74	ReplayName *string
75
76	// A time stamp for the time that the replay started.
77	ReplayStartTime *time.Time
78
79	// The current state of the replay.
80	State types.ReplayState
81
82	// The reason that the replay is in the current state.
83	StateReason *string
84
85	// Metadata pertaining to the operation's result.
86	ResultMetadata middleware.Metadata
87}
88
89func addOperationDescribeReplayMiddlewares(stack *middleware.Stack, options Options) (err error) {
90	err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeReplay{}, middleware.After)
91	if err != nil {
92		return err
93	}
94	err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeReplay{}, middleware.After)
95	if err != nil {
96		return err
97	}
98	if err = addSetLoggerMiddleware(stack, options); err != nil {
99		return err
100	}
101	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
102		return err
103	}
104	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
105		return err
106	}
107	if err = addResolveEndpointMiddleware(stack, options); err != nil {
108		return err
109	}
110	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
111		return err
112	}
113	if err = addRetryMiddlewares(stack, options); err != nil {
114		return err
115	}
116	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
117		return err
118	}
119	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
120		return err
121	}
122	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
123		return err
124	}
125	if err = addClientUserAgent(stack); err != nil {
126		return err
127	}
128	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
129		return err
130	}
131	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
132		return err
133	}
134	if err = addOpDescribeReplayValidationMiddleware(stack); err != nil {
135		return err
136	}
137	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeReplay(options.Region), middleware.Before); err != nil {
138		return err
139	}
140	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
141		return err
142	}
143	if err = addResponseErrorMiddleware(stack); err != nil {
144		return err
145	}
146	if err = addRequestResponseLogging(stack, options); err != nil {
147		return err
148	}
149	return nil
150}
151
152func newServiceMetadataMiddleware_opDescribeReplay(region string) *awsmiddleware.RegisterServiceMetadata {
153	return &awsmiddleware.RegisterServiceMetadata{
154		Region:        region,
155		ServiceID:     ServiceID,
156		SigningName:   "events",
157		OperationName: "DescribeReplay",
158	}
159}
160