// Code generated by smithy-go-codegen DO NOT EDIT.

package awsrestjson

import (
	"context"
	"github.com/aws/aws-sdk-go-v2/internal/protocoltest/awsrestjson/schemas"
	smithy "github.com/aws/smithy-go"
	"github.com/aws/smithy-go/middleware"
	smithyhttp "github.com/aws/smithy-go/transport/http"
)

// This example ensures that query string bound request parameters are serialized
// in the body of responses if the structure is used in both the request and
// response.
func (c *Client) IgnoreQueryParamsInResponse(ctx context.Context, params *IgnoreQueryParamsInResponseInput, optFns ...func(*Options)) (*IgnoreQueryParamsInResponseOutput, error) {
	if params == nil {
		params = &IgnoreQueryParamsInResponseInput{}
	}

	result, metadata, err := c.invokeOperation(ctx, "IgnoreQueryParamsInResponse", params, optFns, c.addOperationIgnoreQueryParamsInResponseMiddlewares)
	if err != nil {
		return nil, err
	}

	out := result.(*IgnoreQueryParamsInResponseOutput)
	out.ResultMetadata = metadata
	return out, nil
}

type IgnoreQueryParamsInResponseInput struct {
	noSmithyDocumentSerde
}

func (v *IgnoreQueryParamsInResponseInput) Serialize(s smithy.ShapeSerializer) {
	s.WriteStruct(nil)
	v.SerializeMembers(s)
	s.CloseStruct()
}

func (v *IgnoreQueryParamsInResponseInput) SerializeMembers(s smithy.ShapeSerializer) {
}
func (v *IgnoreQueryParamsInResponseInput) Deserialize(d smithy.ShapeDeserializer) error {
	return smithy.ReadStruct(d, nil, func(s *smithy.Schema) error {
		switch s {
		}
		return nil
	})
}

type IgnoreQueryParamsInResponseOutput struct {
	Baz *string

	// Metadata pertaining to the operation's result.
	ResultMetadata middleware.Metadata

	noSmithyDocumentSerde
}

func (v *IgnoreQueryParamsInResponseOutput) Serialize(s smithy.ShapeSerializer) {
	s.WriteStruct(schemas.IgnoreQueryParamsInResponseOutput)
	v.SerializeMembers(s)
	s.CloseStruct()
}

func (v *IgnoreQueryParamsInResponseOutput) SerializeMembers(s smithy.ShapeSerializer) {
	if v.Baz != nil {
		s.WriteString(schemas.IgnoreQueryParamsInResponseOutput_baz, *v.Baz)
	}
}
func (v *IgnoreQueryParamsInResponseOutput) Deserialize(d smithy.ShapeDeserializer) error {
	return smithy.ReadStruct(d, schemas.IgnoreQueryParamsInResponseOutput, func(s *smithy.Schema) error {
		switch s {
		case schemas.IgnoreQueryParamsInResponseOutput_baz:
			v.Baz = new(string)
			return d.ReadString(schemas.IgnoreQueryParamsInResponseOutput_baz, v.Baz)
		}
		return nil
	})
}
func (c *Client) addOperationIgnoreQueryParamsInResponseMiddlewares(stack *middleware.Stack, options Options) (err error) {
	if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.IgnoreQueryParamsInResponse, nil, schemas.IgnoreQueryParamsInResponseOutput)}, middleware.After); err != nil {
		return err
	}
	if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.IgnoreQueryParamsInResponse, nil, schemas.IgnoreQueryParamsInResponseOutput), output: &IgnoreQueryParamsInResponseOutput{}}, middleware.After); err != nil {
		return err
	}

	if err = addlegacyEndpointContextSetter(stack, options); err != nil {
		return err
	}
	if err = addComputeContentLength(stack); err != nil {
		return err
	}
	if err = addResolveEndpointMiddleware(stack, options); err != nil {
		return err
	}
	if err = addComputePayloadSHA256(stack); err != nil {
		return err
	}
	if err = addRecordResponseTiming(stack, options); err != nil {
		return err
	}
	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
		return err
	}
	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
		return err
	}
	if err = addCredentialSource(stack, options); err != nil {
		return err
	}
	if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "IgnoreQueryParamsInResponse"), middleware.Before); err != nil {
		return err
	}
	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
		return err
	}
	if err = addResponseErrorMiddleware(stack); err != nil {
		return err
	}
	if err = addRequestResponseLogging(stack, options); err != nil {
		return err
	}
	if err = addDisableHTTPSMiddleware(stack, options); err != nil {
		return err
	}
	if err = addInterceptors(stack, options); err != nil {
		return err
	}
	return nil
}
