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

package restxml

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

func (c *Client) QueryParamsAsStringListMap(ctx context.Context, params *QueryParamsAsStringListMapInput, optFns ...func(*Options)) (*QueryParamsAsStringListMapOutput, error) {
	if params == nil {
		params = &QueryParamsAsStringListMapInput{}
	}

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

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

type QueryParamsAsStringListMapInput struct {
	Foo map[string][]string

	Qux *string

	noSmithyDocumentSerde
}

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

func (v *QueryParamsAsStringListMapInput) SerializeMembers(s smithy.ShapeSerializer) {
	serializeStringListMap(s, schemas.QueryParamsAsStringListMapInput_foo, v.Foo)
	if v.Qux != nil {
		s.WriteString(schemas.QueryParamsAsStringListMapInput_qux, *v.Qux)
	}
}
func (v *QueryParamsAsStringListMapInput) Deserialize(d smithy.ShapeDeserializer) error {
	return smithy.ReadStruct(d, schemas.QueryParamsAsStringListMapInput, func(s *smithy.Schema) error {
		switch s {
		case schemas.QueryParamsAsStringListMapInput_foo:
			return deserializeStringListMap(d, schemas.QueryParamsAsStringListMapInput_foo, &v.Foo)
		case schemas.QueryParamsAsStringListMapInput_qux:
			v.Qux = new(string)
			return d.ReadString(schemas.QueryParamsAsStringListMapInput_qux, v.Qux)
		}
		return nil
	})
}

type QueryParamsAsStringListMapOutput struct {
	// Metadata pertaining to the operation's result.
	ResultMetadata middleware.Metadata

	noSmithyDocumentSerde
}

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

func (v *QueryParamsAsStringListMapOutput) SerializeMembers(s smithy.ShapeSerializer) {
}
func (v *QueryParamsAsStringListMapOutput) Deserialize(d smithy.ShapeDeserializer) error {
	return smithy.ReadStruct(d, nil, func(s *smithy.Schema) error {
		switch s {
		}
		return nil
	})
}
func (c *Client) addOperationQueryParamsAsStringListMapMiddlewares(stack *middleware.Stack, options Options) (err error) {
	if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.QueryParamsAsStringListMap, schemas.QueryParamsAsStringListMapInput, nil)}, middleware.After); err != nil {
		return err
	}
	if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.QueryParamsAsStringListMap, schemas.QueryParamsAsStringListMapInput, nil), output: &QueryParamsAsStringListMapOutput{}}, 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, "QueryParamsAsStringListMap"), 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
}
