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

package jsonrpc10

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

// The example tests how servers must support requests containing a Content-Type
// header with parameters.
func (c *Client) ContentTypeParameters(ctx context.Context, params *ContentTypeParametersInput, optFns ...func(*Options)) (*ContentTypeParametersOutput, error) {
	if params == nil {
		params = &ContentTypeParametersInput{}
	}

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

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

type ContentTypeParametersInput struct {
	Value *int32

	noSmithyDocumentSerde
}

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

func (v *ContentTypeParametersInput) SerializeMembers(s smithy.ShapeSerializer) {
	if v.Value != nil {
		s.WriteInt32(schemas.ContentTypeParametersInput_value, *v.Value)
	}
}

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

	noSmithyDocumentSerde
}

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

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