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

package query

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

// Flattened maps with @xmlNamespace and @xmlName
func (c *Client) FlattenedXmlMapWithXmlNamespace(ctx context.Context, params *FlattenedXmlMapWithXmlNamespaceInput, optFns ...func(*Options)) (*FlattenedXmlMapWithXmlNamespaceOutput, error) {
	if params == nil {
		params = &FlattenedXmlMapWithXmlNamespaceInput{}
	}

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

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

type FlattenedXmlMapWithXmlNamespaceInput struct {
	noSmithyDocumentSerde
}

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

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

type FlattenedXmlMapWithXmlNamespaceOutput struct {
	MyMap map[string]string

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

	noSmithyDocumentSerde
}

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

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