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

package smithyrpcv2cbor

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

func (c *Client) Float16(ctx context.Context, params *Float16Input, optFns ...func(*Options)) (*Float16Output, error) {
	if params == nil {
		params = &Float16Input{}
	}

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

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

type Float16Input struct {
	noSmithyDocumentSerde
}

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

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

type Float16Output struct {
	Value *float64

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

	noSmithyDocumentSerde
}

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

func (v *Float16Output) SerializeMembers(s smithy.ShapeSerializer) {
	if v.Value != nil {
		s.WriteFloat64(schemas.Float16Output_value, *v.Value)
	}
}
func (v *Float16Output) Deserialize(d smithy.ShapeDeserializer) error {
	return smithy.ReadStruct(d, schemas.Float16Output, func(s *smithy.Schema) error {
		switch s {
		case schemas.Float16Output_value:
			v.Value = new(float64)
			return d.ReadFloat64(schemas.Float16Output_value, v.Value)
		}
		return nil
	})
}
func (c *Client) addOperationFloat16Middlewares(stack *middleware.Stack, options Options) (err error) {
	if err := stack.Serialize.Add(&serializeRequestMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.Float16, nil, schemas.Float16Output)}, middleware.After); err != nil {
		return err
	}
	if err := stack.Deserialize.Add(&deserializeResponseMiddleware{options: &options, operationSchema: smithy.NewOperationSchema(schemas.Float16, nil, schemas.Float16Output), output: &Float16Output{}}, 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 = 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 = addUserAgentFeatureProtocolRPCV2CBOR(stack, options); err != nil {
		return err
	}
	if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "Float16"), 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
}
