// 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"
)

func (c *Client) SimpleScalarXmlProperties(ctx context.Context, params *SimpleScalarXmlPropertiesInput, optFns ...func(*Options)) (*SimpleScalarXmlPropertiesOutput, error) {
	if params == nil {
		params = &SimpleScalarXmlPropertiesInput{}
	}

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

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

type SimpleScalarXmlPropertiesInput struct {
	noSmithyDocumentSerde
}

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

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

type SimpleScalarXmlPropertiesOutput struct {
	ByteValue *int8

	DoubleValue *float64

	EmptyStringValue *string

	FalseBooleanValue *bool

	FloatValue *float32

	IntegerValue *int32

	LongValue *int64

	ShortValue *int16

	StringValue *string

	TrueBooleanValue *bool

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

	noSmithyDocumentSerde
}

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

func (v *SimpleScalarXmlPropertiesOutput) SerializeMembers(s smithy.ShapeSerializer) {
	if v.ByteValue != nil {
		s.WriteInt8(schemas.SimpleScalarXmlPropertiesOutput_byteValue, *v.ByteValue)
	}
	if v.DoubleValue != nil {
		s.WriteFloat64(schemas.SimpleScalarXmlPropertiesOutput_doubleValue, *v.DoubleValue)
	}
	if v.EmptyStringValue != nil {
		s.WriteString(schemas.SimpleScalarXmlPropertiesOutput_emptyStringValue, *v.EmptyStringValue)
	}
	if v.FalseBooleanValue != nil {
		s.WriteBool(schemas.SimpleScalarXmlPropertiesOutput_falseBooleanValue, *v.FalseBooleanValue)
	}
	if v.FloatValue != nil {
		s.WriteFloat32(schemas.SimpleScalarXmlPropertiesOutput_floatValue, *v.FloatValue)
	}
	if v.IntegerValue != nil {
		s.WriteInt32(schemas.SimpleScalarXmlPropertiesOutput_integerValue, *v.IntegerValue)
	}
	if v.LongValue != nil {
		s.WriteInt64(schemas.SimpleScalarXmlPropertiesOutput_longValue, *v.LongValue)
	}
	if v.ShortValue != nil {
		s.WriteInt16(schemas.SimpleScalarXmlPropertiesOutput_shortValue, *v.ShortValue)
	}
	if v.StringValue != nil {
		s.WriteString(schemas.SimpleScalarXmlPropertiesOutput_stringValue, *v.StringValue)
	}
	if v.TrueBooleanValue != nil {
		s.WriteBool(schemas.SimpleScalarXmlPropertiesOutput_trueBooleanValue, *v.TrueBooleanValue)
	}
}
func (v *SimpleScalarXmlPropertiesOutput) Deserialize(d smithy.ShapeDeserializer) error {
	return smithy.ReadStruct(d, schemas.SimpleScalarXmlPropertiesOutput, func(s *smithy.Schema) error {
		switch s {
		case schemas.SimpleScalarXmlPropertiesOutput_byteValue:
			v.ByteValue = new(int8)
			return d.ReadInt8(schemas.SimpleScalarXmlPropertiesOutput_byteValue, v.ByteValue)
		case schemas.SimpleScalarXmlPropertiesOutput_doubleValue:
			v.DoubleValue = new(float64)
			return d.ReadFloat64(schemas.SimpleScalarXmlPropertiesOutput_doubleValue, v.DoubleValue)
		case schemas.SimpleScalarXmlPropertiesOutput_emptyStringValue:
			v.EmptyStringValue = new(string)
			return d.ReadString(schemas.SimpleScalarXmlPropertiesOutput_emptyStringValue, v.EmptyStringValue)
		case schemas.SimpleScalarXmlPropertiesOutput_falseBooleanValue:
			v.FalseBooleanValue = new(bool)
			return d.ReadBool(schemas.SimpleScalarXmlPropertiesOutput_falseBooleanValue, v.FalseBooleanValue)
		case schemas.SimpleScalarXmlPropertiesOutput_floatValue:
			v.FloatValue = new(float32)
			return d.ReadFloat32(schemas.SimpleScalarXmlPropertiesOutput_floatValue, v.FloatValue)
		case schemas.SimpleScalarXmlPropertiesOutput_integerValue:
			v.IntegerValue = new(int32)
			return d.ReadInt32(schemas.SimpleScalarXmlPropertiesOutput_integerValue, v.IntegerValue)
		case schemas.SimpleScalarXmlPropertiesOutput_longValue:
			v.LongValue = new(int64)
			return d.ReadInt64(schemas.SimpleScalarXmlPropertiesOutput_longValue, v.LongValue)
		case schemas.SimpleScalarXmlPropertiesOutput_shortValue:
			v.ShortValue = new(int16)
			return d.ReadInt16(schemas.SimpleScalarXmlPropertiesOutput_shortValue, v.ShortValue)
		case schemas.SimpleScalarXmlPropertiesOutput_stringValue:
			v.StringValue = new(string)
			return d.ReadString(schemas.SimpleScalarXmlPropertiesOutput_stringValue, v.StringValue)
		case schemas.SimpleScalarXmlPropertiesOutput_trueBooleanValue:
			v.TrueBooleanValue = new(bool)
			return d.ReadBool(schemas.SimpleScalarXmlPropertiesOutput_trueBooleanValue, v.TrueBooleanValue)
		}
		return nil
	})
}
func (c *Client) addOperationSimpleScalarXmlPropertiesMiddlewares(stack *middleware.Stack, options Options) (err error) {
	if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.SimpleScalarXmlProperties, nil, schemas.SimpleScalarXmlPropertiesOutput)}, middleware.After); err != nil {
		return err
	}
	if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.SimpleScalarXmlProperties, nil, schemas.SimpleScalarXmlPropertiesOutput), output: &SimpleScalarXmlPropertiesOutput{}}, 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, "SimpleScalarXmlProperties"), 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
}
