1// Code generated by smithy-go-codegen DO NOT EDIT. 2 3package cloudwatchevents 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/cloudwatchevents/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 an API destination. 16func (c *Client) DescribeApiDestination(ctx context.Context, params *DescribeApiDestinationInput, optFns ...func(*Options)) (*DescribeApiDestinationOutput, error) { 17 if params == nil { 18 params = &DescribeApiDestinationInput{} 19 } 20 21 result, metadata, err := c.invokeOperation(ctx, "DescribeApiDestination", params, optFns, c.addOperationDescribeApiDestinationMiddlewares) 22 if err != nil { 23 return nil, err 24 } 25 26 out := result.(*DescribeApiDestinationOutput) 27 out.ResultMetadata = metadata 28 return out, nil 29} 30 31type DescribeApiDestinationInput struct { 32 33 // The name of the API destination to retrieve. 34 // 35 // This member is required. 36 Name *string 37 38 noSmithyDocumentSerde 39} 40 41type DescribeApiDestinationOutput struct { 42 43 // The ARN of the API destination retrieved. 44 ApiDestinationArn *string 45 46 // The state of the API destination retrieved. 47 ApiDestinationState types.ApiDestinationState 48 49 // The ARN of the connection specified for the API destination retrieved. 50 ConnectionArn *string 51 52 // A time stamp for the time that the API destination was created. 53 CreationTime *time.Time 54 55 // The description for the API destination retrieved. 56 Description *string 57 58 // The method to use to connect to the HTTP endpoint. 59 HttpMethod types.ApiDestinationHttpMethod 60 61 // The URL to use to connect to the HTTP endpoint. 62 InvocationEndpoint *string 63 64 // The maximum number of invocations per second to specified for the API 65 // destination. Note that if you set the invocation rate maximum to a value lower 66 // the rate necessary to send all events received on to the destination HTTP 67 // endpoint, some events may not be delivered within the 24-hour retry window. If 68 // you plan to set the rate lower than the rate necessary to deliver all events, 69 // consider using a dead-letter queue to catch events that are not delivered within 70 // 24 hours. 71 InvocationRateLimitPerSecond *int32 72 73 // A time stamp for the time that the API destination was last modified. 74 LastModifiedTime *time.Time 75 76 // The name of the API destination retrieved. 77 Name *string 78 79 // Metadata pertaining to the operation's result. 80 ResultMetadata middleware.Metadata 81 82 noSmithyDocumentSerde 83} 84 85func (c *Client) addOperationDescribeApiDestinationMiddlewares(stack *middleware.Stack, options Options) (err error) { 86 err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeApiDestination{}, middleware.After) 87 if err != nil { 88 return err 89 } 90 err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeApiDestination{}, middleware.After) 91 if err != nil { 92 return err 93 } 94 if err = addSetLoggerMiddleware(stack, options); err != nil { 95 return err 96 } 97 if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { 98 return err 99 } 100 if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { 101 return err 102 } 103 if err = addResolveEndpointMiddleware(stack, options); err != nil { 104 return err 105 } 106 if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { 107 return err 108 } 109 if err = addRetryMiddlewares(stack, options); err != nil { 110 return err 111 } 112 if err = addHTTPSignerV4Middleware(stack, options); err != nil { 113 return err 114 } 115 if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { 116 return err 117 } 118 if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { 119 return err 120 } 121 if err = addClientUserAgent(stack); err != nil { 122 return err 123 } 124 if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { 125 return err 126 } 127 if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { 128 return err 129 } 130 if err = addOpDescribeApiDestinationValidationMiddleware(stack); err != nil { 131 return err 132 } 133 if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeApiDestination(options.Region), middleware.Before); err != nil { 134 return err 135 } 136 if err = addRequestIDRetrieverMiddleware(stack); err != nil { 137 return err 138 } 139 if err = addResponseErrorMiddleware(stack); err != nil { 140 return err 141 } 142 if err = addRequestResponseLogging(stack, options); err != nil { 143 return err 144 } 145 return nil 146} 147 148func newServiceMetadataMiddleware_opDescribeApiDestination(region string) *awsmiddleware.RegisterServiceMetadata { 149 return &awsmiddleware.RegisterServiceMetadata{ 150 Region: region, 151 ServiceID: ServiceID, 152 SigningName: "events", 153 OperationName: "DescribeApiDestination", 154 } 155} 156