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/aws-sdk-go-v2/internal/protocoltest/awsrestjson/types" 9 "github.com/aws/smithy-go/middleware" 10 smithyhttp "github.com/aws/smithy-go/transport/http" 11 "time" 12) 13 14// The example tests how requests and responses are serialized when there is no 15// input or output payload but there are HTTP header bindings. 16func (c *Client) InputAndOutputWithHeaders(ctx context.Context, params *InputAndOutputWithHeadersInput, optFns ...func(*Options)) (*InputAndOutputWithHeadersOutput, error) { 17 if params == nil { 18 params = &InputAndOutputWithHeadersInput{} 19 } 20 21 result, metadata, err := c.invokeOperation(ctx, "InputAndOutputWithHeaders", params, optFns, addOperationInputAndOutputWithHeadersMiddlewares) 22 if err != nil { 23 return nil, err 24 } 25 26 out := result.(*InputAndOutputWithHeadersOutput) 27 out.ResultMetadata = metadata 28 return out, nil 29} 30 31type InputAndOutputWithHeadersInput struct { 32 HeaderBooleanList []bool 33 34 HeaderByte *int8 35 36 HeaderDouble *float64 37 38 HeaderEnum types.FooEnum 39 40 HeaderEnumList []types.FooEnum 41 42 HeaderFalseBool *bool 43 44 HeaderFloat *float32 45 46 HeaderInteger *int32 47 48 HeaderIntegerList []int32 49 50 HeaderLong *int64 51 52 HeaderShort *int16 53 54 HeaderString *string 55 56 HeaderStringList []string 57 58 HeaderStringSet []string 59 60 HeaderTimestampList []time.Time 61 62 HeaderTrueBool *bool 63} 64 65type InputAndOutputWithHeadersOutput struct { 66 HeaderBooleanList []bool 67 68 HeaderByte *int8 69 70 HeaderDouble *float64 71 72 HeaderEnum types.FooEnum 73 74 HeaderEnumList []types.FooEnum 75 76 HeaderFalseBool *bool 77 78 HeaderFloat *float32 79 80 HeaderInteger *int32 81 82 HeaderIntegerList []int32 83 84 HeaderLong *int64 85 86 HeaderShort *int16 87 88 HeaderString *string 89 90 HeaderStringList []string 91 92 HeaderStringSet []string 93 94 HeaderTimestampList []time.Time 95 96 HeaderTrueBool *bool 97 98 // Metadata pertaining to the operation's result. 99 ResultMetadata middleware.Metadata 100} 101 102func addOperationInputAndOutputWithHeadersMiddlewares(stack *middleware.Stack, options Options) (err error) { 103 err = stack.Serialize.Add(&awsRestjson1_serializeOpInputAndOutputWithHeaders{}, middleware.After) 104 if err != nil { 105 return err 106 } 107 err = stack.Deserialize.Add(&awsRestjson1_deserializeOpInputAndOutputWithHeaders{}, middleware.After) 108 if err != nil { 109 return err 110 } 111 if err = addSetLoggerMiddleware(stack, options); err != nil { 112 return err 113 } 114 if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { 115 return err 116 } 117 if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { 118 return err 119 } 120 if err = addResolveEndpointMiddleware(stack, options); err != nil { 121 return err 122 } 123 if err = addRetryMiddlewares(stack, options); err != nil { 124 return err 125 } 126 if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { 127 return err 128 } 129 if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { 130 return err 131 } 132 if err = addClientUserAgent(stack); err != nil { 133 return err 134 } 135 if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { 136 return err 137 } 138 if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { 139 return err 140 } 141 if err = stack.Initialize.Add(newServiceMetadataMiddleware_opInputAndOutputWithHeaders(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_opInputAndOutputWithHeaders(region string) *awsmiddleware.RegisterServiceMetadata { 157 return &awsmiddleware.RegisterServiceMetadata{ 158 Region: region, 159 ServiceID: ServiceID, 160 OperationName: "InputAndOutputWithHeaders", 161 } 162} 163