1// Code generated by smithy-go-codegen DO NOT EDIT. 2 3package awsrestjson 4 5import ( 6 "context" 7 awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" 8 "github.com/aws/smithy-go/middleware" 9 smithyhttp "github.com/aws/smithy-go/transport/http" 10) 11 12// The example tests how requests and responses are serialized when there's no 13// request or response payload because the operation has an empty input and empty 14// output structure that reuses the same shape. While this should be rare, code 15// generators must support this. 16func (c *Client) EmptyInputAndEmptyOutput(ctx context.Context, params *EmptyInputAndEmptyOutputInput, optFns ...func(*Options)) (*EmptyInputAndEmptyOutputOutput, error) { 17 if params == nil { 18 params = &EmptyInputAndEmptyOutputInput{} 19 } 20 21 result, metadata, err := c.invokeOperation(ctx, "EmptyInputAndEmptyOutput", params, optFns, addOperationEmptyInputAndEmptyOutputMiddlewares) 22 if err != nil { 23 return nil, err 24 } 25 26 out := result.(*EmptyInputAndEmptyOutputOutput) 27 out.ResultMetadata = metadata 28 return out, nil 29} 30 31type EmptyInputAndEmptyOutputInput struct { 32} 33 34type EmptyInputAndEmptyOutputOutput struct { 35 // Metadata pertaining to the operation's result. 36 ResultMetadata middleware.Metadata 37} 38 39func addOperationEmptyInputAndEmptyOutputMiddlewares(stack *middleware.Stack, options Options) (err error) { 40 err = stack.Serialize.Add(&awsRestjson1_serializeOpEmptyInputAndEmptyOutput{}, middleware.After) 41 if err != nil { 42 return err 43 } 44 err = stack.Deserialize.Add(&awsRestjson1_deserializeOpEmptyInputAndEmptyOutput{}, middleware.After) 45 if err != nil { 46 return err 47 } 48 if err = addSetLoggerMiddleware(stack, options); err != nil { 49 return err 50 } 51 if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { 52 return err 53 } 54 if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { 55 return err 56 } 57 if err = addResolveEndpointMiddleware(stack, options); err != nil { 58 return err 59 } 60 if err = addRetryMiddlewares(stack, options); err != nil { 61 return err 62 } 63 if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { 64 return err 65 } 66 if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { 67 return err 68 } 69 if err = addClientUserAgent(stack); err != nil { 70 return err 71 } 72 if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { 73 return err 74 } 75 if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { 76 return err 77 } 78 if err = stack.Initialize.Add(newServiceMetadataMiddleware_opEmptyInputAndEmptyOutput(options.Region), middleware.Before); err != nil { 79 return err 80 } 81 if err = addRequestIDRetrieverMiddleware(stack); err != nil { 82 return err 83 } 84 if err = addResponseErrorMiddleware(stack); err != nil { 85 return err 86 } 87 if err = addRequestResponseLogging(stack, options); err != nil { 88 return err 89 } 90 return nil 91} 92 93func newServiceMetadataMiddleware_opEmptyInputAndEmptyOutput(region string) *awsmiddleware.RegisterServiceMetadata { 94 return &awsmiddleware.RegisterServiceMetadata{ 95 Region: region, 96 ServiceID: ServiceID, 97 OperationName: "EmptyInputAndEmptyOutput", 98 } 99} 100