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

//go:build request_snapshot

package sqs

import (
	"bytes"
	"context"
	"errors"
	"fmt"
	"github.com/aws/aws-sdk-go-v2/service/sqs/types"
	smithyendpoints "github.com/aws/smithy-go/endpoints"
	"github.com/aws/smithy-go/middleware"
	"github.com/aws/smithy-go/ptr"
	smithyhttp "github.com/aws/smithy-go/transport/http"
	"io"
	"io/fs"
	"net/url"
	"os"
	"slices"
	"strings"
	"testing"
)

const serdeSSPrefix = "request_snapshot"

// errSerdeSnapshotOK is returned by the capture middleware to abort the request
// pipeline once the serialized request has been captured, so no network call is
// made. It is a control signal, not a failure.
var errSerdeSnapshotOK = errors.New("serde snapshot: request captured")

func serdeCreatePath(path string) (*os.File, error) {
	if err := os.MkdirAll(serdeSSPrefix, 0700); err != nil && !errors.Is(err, fs.ErrExist) {
		return nil, err
	}
	return os.Create(path)
}

func serdeSSPath(op string) string {
	return fmt.Sprintf("%s/%s.request.snap", serdeSSPrefix, op)
}

type captureSerdeRequestMiddleware struct {
	body     *bytes.Buffer
	method   *string
	rawPath  *string
	rawQuery *string
	header   *map[string][]string
}

func (*captureSerdeRequestMiddleware) ID() string { return "captureSerdeRequest" }

func (m *captureSerdeRequestMiddleware) HandleFinalize(
	ctx context.Context, input middleware.FinalizeInput, next middleware.FinalizeHandler,
) (
	middleware.FinalizeOutput, middleware.Metadata, error,
) {
	req, ok := input.Request.(*smithyhttp.Request)
	if !ok {
		return middleware.FinalizeOutput{}, middleware.Metadata{}, fmt.Errorf("unexpected transport type %T", input.Request)
	}

	built := req.Build(ctx)
	*m.method = built.Method
	*m.rawPath = built.URL.RawPath
	if *m.rawPath == "" {
		*m.rawPath = built.URL.Path
	}
	*m.rawQuery = built.URL.RawQuery
	*m.header = built.Header

	if built.Body != nil {
		if _, err := io.Copy(m.body, built.Body); err != nil {
			return middleware.FinalizeOutput{}, middleware.Metadata{}, err
		}
	}

	return middleware.FinalizeOutput{}, middleware.Metadata{}, errSerdeSnapshotOK
}

func serdeFormatRequest(method, rawPath, rawQuery string, header map[string][]string, body []byte) string {
	skipHeaders := map[string]bool{
		"Authorization":         true,
		"User-Agent":            true,
		"X-Amz-Date":            true,
		"X-Amz-Security-Token":  true,
		"Amz-Sdk-Invocation-Id": true,
		"Amz-Sdk-Request":       true,
	}

	var sb strings.Builder
	sb.WriteString(method)
	sb.WriteString(" ")
	sb.WriteString(rawPath)
	if rawQuery != "" {
		sb.WriteString("?")
		sb.WriteString(rawQuery)
	}
	sb.WriteString("\n\n")

	keys := make([]string, 0, len(header))
	for k := range header {
		if skipHeaders[k] {
			continue
		}
		keys = append(keys, k)
	}
	slices.Sort(keys)
	for _, k := range keys {
		for _, v := range header[k] {
			sb.WriteString(k)
			sb.WriteString(": ")
			sb.WriteString(v)
			sb.WriteString("\n")
		}
	}
	sb.WriteString("\n")
	if len(body) > 0 {
		sb.Write(body)
	}
	return sb.String()
}

func serdeUpdateSnapshot(method, rawPath, rawQuery string, header map[string][]string, body []byte, operation string) error {
	content := serdeFormatRequest(method, rawPath, rawQuery, header, body)
	// Leave the snapshot untouched if it's semantically equal to the new one.
	// Some protocols (rpcv2Cbor) serialize map/struct fields in a nondeterministic
	// byte order, so a blind rewrite would churn the file on every run.
	if existing, err := os.ReadFile(serdeSSPath(operation)); err == nil {
		prefix := serdeFormatRequest(method, rawPath, rawQuery, header, nil)
		if strings.HasPrefix(string(existing), prefix) &&
			serdeBodyEqual(body, []byte(string(existing)[len(prefix):])) {
			return nil
		}
	}
	f, err := serdeCreatePath(serdeSSPath(operation))
	if err != nil {
		return err
	}
	defer f.Close()
	if _, err := f.Write([]byte(content)); err != nil {
		return err
	}
	return nil
}

func serdeTestSnapshot(method, rawPath, rawQuery string, header map[string][]string, body []byte, operation string) error {
	f, err := os.Open(serdeSSPath(operation))
	if errors.Is(err, fs.ErrNotExist) {
		return nil
	}
	if err != nil {
		return err
	}
	defer f.Close()
	expected, err := io.ReadAll(f)
	if err != nil {
		return err
	}
	prefix := serdeFormatRequest(method, rawPath, rawQuery, header, nil)
	if !strings.HasPrefix(string(expected), prefix) ||
		!serdeBodyEqual(body, []byte(string(expected)[len(prefix):])) {
		content := serdeFormatRequest(method, rawPath, rawQuery, header, body)
		return fmt.Errorf("serde snapshot mismatch for %s:\nGOT:\n%s:\nEXPECTED:\n%s", operation, content, string(expected))
	}
	return nil
}

type serdeEndpointResolver struct{}

func (*serdeEndpointResolver) ResolveEndpoint(ctx context.Context, params EndpointParameters) (smithyendpoints.Endpoint, error) {
	return smithyendpoints.Endpoint{URI: url.URL{Scheme: "https", Host: "test.example.com"}}, nil
}

func serdeNewClient() *Client {
	return New(Options{
		Region:             "us-east-1",
		EndpointResolverV2: &serdeEndpointResolver{},
	})
}
func serdeBodyEqual(got, expected []byte) bool {
	return bytes.Equal(got, expected)
}
func TestCheckRequestSnapshot_AddPermission(t *testing.T) {
	input := &AddPermissionInput{
		QueueUrl: ptr.String("__QueueUrl__"),
		Label:    ptr.String("__Label__"),
		AWSAccountIds: []string{
			"__Member__",
			"__Member__",
		},
		Actions: []string{
			"__Member__",
			"__Member__",
		},
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.AddPermission(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeTestSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "AddPermission"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_CancelMessageMoveTask(t *testing.T) {
	input := &CancelMessageMoveTaskInput{
		TaskHandle: ptr.String("__TaskHandle__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.CancelMessageMoveTask(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeTestSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "CancelMessageMoveTask"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_ChangeMessageVisibility(t *testing.T) {
	input := &ChangeMessageVisibilityInput{
		QueueUrl:          ptr.String("__QueueUrl__"),
		ReceiptHandle:     ptr.String("__ReceiptHandle__"),
		VisibilityTimeout: 1,
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.ChangeMessageVisibility(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeTestSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "ChangeMessageVisibility"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_ChangeMessageVisibilityBatch(t *testing.T) {
	input := &ChangeMessageVisibilityBatchInput{
		QueueUrl: ptr.String("__QueueUrl__"),
		Entries: []types.ChangeMessageVisibilityBatchRequestEntry{
			{
				Id:                ptr.String("__Id__"),
				ReceiptHandle:     ptr.String("__ReceiptHandle__"),
				VisibilityTimeout: 1,
			},
			{
				Id:                ptr.String("__Id__"),
				ReceiptHandle:     ptr.String("__ReceiptHandle__"),
				VisibilityTimeout: 1,
			},
		},
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.ChangeMessageVisibilityBatch(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeTestSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "ChangeMessageVisibilityBatch"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_CreateQueue(t *testing.T) {
	input := &CreateQueueInput{
		QueueName: ptr.String("__QueueName__"),
		Attributes: map[string]string{
			"key0": "__Value__",
		},
		Tags: map[string]string{
			"key0": "__Value__",
		},
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.CreateQueue(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeTestSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "CreateQueue"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_DeleteMessage(t *testing.T) {
	input := &DeleteMessageInput{
		QueueUrl:      ptr.String("__QueueUrl__"),
		ReceiptHandle: ptr.String("__ReceiptHandle__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.DeleteMessage(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeTestSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "DeleteMessage"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_DeleteMessageBatch(t *testing.T) {
	input := &DeleteMessageBatchInput{
		QueueUrl: ptr.String("__QueueUrl__"),
		Entries: []types.DeleteMessageBatchRequestEntry{
			{
				Id:            ptr.String("__Id__"),
				ReceiptHandle: ptr.String("__ReceiptHandle__"),
			},
			{
				Id:            ptr.String("__Id__"),
				ReceiptHandle: ptr.String("__ReceiptHandle__"),
			},
		},
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.DeleteMessageBatch(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeTestSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "DeleteMessageBatch"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_DeleteQueue(t *testing.T) {
	input := &DeleteQueueInput{
		QueueUrl: ptr.String("__QueueUrl__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.DeleteQueue(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeTestSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "DeleteQueue"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_GetQueueAttributes(t *testing.T) {
	input := &GetQueueAttributesInput{
		QueueUrl: ptr.String("__QueueUrl__"),
		AttributeNames: []types.QueueAttributeName{
			types.QueueAttributeName("All"),
			types.QueueAttributeName("All"),
		},
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.GetQueueAttributes(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeTestSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "GetQueueAttributes"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_GetQueueUrl(t *testing.T) {
	input := &GetQueueUrlInput{
		QueueName:              ptr.String("__QueueName__"),
		QueueOwnerAWSAccountId: ptr.String("__QueueOwnerAWSAccountId__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.GetQueueUrl(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeTestSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "GetQueueUrl"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_ListDeadLetterSourceQueues(t *testing.T) {
	input := &ListDeadLetterSourceQueuesInput{
		QueueUrl:   ptr.String("__QueueUrl__"),
		NextToken:  ptr.String("__NextToken__"),
		MaxResults: ptr.Int32(1),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.ListDeadLetterSourceQueues(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeTestSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "ListDeadLetterSourceQueues"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_ListMessageMoveTasks(t *testing.T) {
	input := &ListMessageMoveTasksInput{
		SourceArn:  ptr.String("__SourceArn__"),
		MaxResults: ptr.Int32(1),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.ListMessageMoveTasks(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeTestSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "ListMessageMoveTasks"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_ListQueues(t *testing.T) {
	input := &ListQueuesInput{
		QueueNamePrefix: ptr.String("__QueueNamePrefix__"),
		NextToken:       ptr.String("__NextToken__"),
		MaxResults:      ptr.Int32(1),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.ListQueues(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeTestSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "ListQueues"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_ListQueueTags(t *testing.T) {
	input := &ListQueueTagsInput{
		QueueUrl: ptr.String("__QueueUrl__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.ListQueueTags(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeTestSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "ListQueueTags"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_PurgeQueue(t *testing.T) {
	input := &PurgeQueueInput{
		QueueUrl: ptr.String("__QueueUrl__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.PurgeQueue(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeTestSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "PurgeQueue"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_ReceiveMessage(t *testing.T) {
	input := &ReceiveMessageInput{
		QueueUrl: ptr.String("__QueueUrl__"),
		AttributeNames: []types.QueueAttributeName{
			types.QueueAttributeName("All"),
			types.QueueAttributeName("All"),
		},
		MessageSystemAttributeNames: []types.MessageSystemAttributeName{
			types.MessageSystemAttributeName("All"),
			types.MessageSystemAttributeName("All"),
		},
		MessageAttributeNames: []string{
			"__Member__",
			"__Member__",
		},
		MaxNumberOfMessages:     1,
		VisibilityTimeout:       1,
		WaitTimeSeconds:         1,
		ReceiveRequestAttemptId: ptr.String("__ReceiveRequestAttemptId__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.ReceiveMessage(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeTestSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "ReceiveMessage"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_RemovePermission(t *testing.T) {
	input := &RemovePermissionInput{
		QueueUrl: ptr.String("__QueueUrl__"),
		Label:    ptr.String("__Label__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.RemovePermission(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeTestSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "RemovePermission"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_SendMessage(t *testing.T) {
	input := &SendMessageInput{
		QueueUrl:     ptr.String("__QueueUrl__"),
		MessageBody:  ptr.String("__MessageBody__"),
		DelaySeconds: 1,
		MessageAttributes: map[string]types.MessageAttributeValue{
			"key0": {
				StringValue: ptr.String("__StringValue__"),
				BinaryValue: []byte("blob"),
				StringListValues: []string{
					"__Member__",
					"__Member__",
				},
				BinaryListValues: [][]byte{
					[]byte("blob"),
					[]byte("blob"),
				},
				DataType: ptr.String("__DataType__"),
			},
		},
		MessageSystemAttributes: map[string]types.MessageSystemAttributeValue{
			"key0": {
				StringValue: ptr.String("__StringValue__"),
				BinaryValue: []byte("blob"),
				StringListValues: []string{
					"__Member__",
					"__Member__",
				},
				BinaryListValues: [][]byte{
					[]byte("blob"),
					[]byte("blob"),
				},
				DataType: ptr.String("__DataType__"),
			},
		},
		MessageDeduplicationId: ptr.String("__MessageDeduplicationId__"),
		MessageGroupId:         ptr.String("__MessageGroupId__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.SendMessage(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeTestSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "SendMessage"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_SendMessageBatch(t *testing.T) {
	input := &SendMessageBatchInput{
		QueueUrl: ptr.String("__QueueUrl__"),
		Entries: []types.SendMessageBatchRequestEntry{
			{
				Id:           ptr.String("__Id__"),
				MessageBody:  ptr.String("__MessageBody__"),
				DelaySeconds: 1,
				MessageAttributes: map[string]types.MessageAttributeValue{
					"key0": {
						StringValue: ptr.String("__StringValue__"),
						BinaryValue: []byte("blob"),
						StringListValues: []string{
							"__Member__",
							"__Member__",
						},
						BinaryListValues: [][]byte{
							[]byte("blob"),
							[]byte("blob"),
						},
						DataType: ptr.String("__DataType__"),
					},
				},
				MessageSystemAttributes: map[string]types.MessageSystemAttributeValue{
					"key0": {
						StringValue: ptr.String("__StringValue__"),
						BinaryValue: []byte("blob"),
						StringListValues: []string{
							"__Member__",
							"__Member__",
						},
						BinaryListValues: [][]byte{
							[]byte("blob"),
							[]byte("blob"),
						},
						DataType: ptr.String("__DataType__"),
					},
				},
				MessageDeduplicationId: ptr.String("__MessageDeduplicationId__"),
				MessageGroupId:         ptr.String("__MessageGroupId__"),
			},
			{
				Id:           ptr.String("__Id__"),
				MessageBody:  ptr.String("__MessageBody__"),
				DelaySeconds: 1,
				MessageAttributes: map[string]types.MessageAttributeValue{
					"key0": {
						StringValue: ptr.String("__StringValue__"),
						BinaryValue: []byte("blob"),
						StringListValues: []string{
							"__Member__",
							"__Member__",
						},
						BinaryListValues: [][]byte{
							[]byte("blob"),
							[]byte("blob"),
						},
						DataType: ptr.String("__DataType__"),
					},
				},
				MessageSystemAttributes: map[string]types.MessageSystemAttributeValue{
					"key0": {
						StringValue: ptr.String("__StringValue__"),
						BinaryValue: []byte("blob"),
						StringListValues: []string{
							"__Member__",
							"__Member__",
						},
						BinaryListValues: [][]byte{
							[]byte("blob"),
							[]byte("blob"),
						},
						DataType: ptr.String("__DataType__"),
					},
				},
				MessageDeduplicationId: ptr.String("__MessageDeduplicationId__"),
				MessageGroupId:         ptr.String("__MessageGroupId__"),
			},
		},
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.SendMessageBatch(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeTestSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "SendMessageBatch"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_SetQueueAttributes(t *testing.T) {
	input := &SetQueueAttributesInput{
		QueueUrl: ptr.String("__QueueUrl__"),
		Attributes: map[string]string{
			"key0": "__Value__",
		},
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.SetQueueAttributes(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeTestSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "SetQueueAttributes"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_StartMessageMoveTask(t *testing.T) {
	input := &StartMessageMoveTaskInput{
		SourceArn:                    ptr.String("__SourceArn__"),
		DestinationArn:               ptr.String("__DestinationArn__"),
		MaxNumberOfMessagesPerSecond: ptr.Int32(1),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.StartMessageMoveTask(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeTestSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "StartMessageMoveTask"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_TagQueue(t *testing.T) {
	input := &TagQueueInput{
		QueueUrl: ptr.String("__QueueUrl__"),
		Tags: map[string]string{
			"key0": "__Value__",
		},
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.TagQueue(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeTestSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "TagQueue"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_UntagQueue(t *testing.T) {
	input := &UntagQueueInput{
		QueueUrl: ptr.String("__QueueUrl__"),
		TagKeys: []string{
			"__Member__",
			"__Member__",
		},
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.UntagQueue(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeTestSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "UntagQueue"); err != nil {
		t.Fatal(err)
	}
}
func TestUpdateRequestSnapshot_AddPermission(t *testing.T) {
	input := &AddPermissionInput{
		QueueUrl: ptr.String("__QueueUrl__"),
		Label:    ptr.String("__Label__"),
		AWSAccountIds: []string{
			"__Member__",
			"__Member__",
		},
		Actions: []string{
			"__Member__",
			"__Member__",
		},
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.AddPermission(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeUpdateSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "AddPermission"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_CancelMessageMoveTask(t *testing.T) {
	input := &CancelMessageMoveTaskInput{
		TaskHandle: ptr.String("__TaskHandle__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.CancelMessageMoveTask(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeUpdateSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "CancelMessageMoveTask"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_ChangeMessageVisibility(t *testing.T) {
	input := &ChangeMessageVisibilityInput{
		QueueUrl:          ptr.String("__QueueUrl__"),
		ReceiptHandle:     ptr.String("__ReceiptHandle__"),
		VisibilityTimeout: 1,
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.ChangeMessageVisibility(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeUpdateSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "ChangeMessageVisibility"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_ChangeMessageVisibilityBatch(t *testing.T) {
	input := &ChangeMessageVisibilityBatchInput{
		QueueUrl: ptr.String("__QueueUrl__"),
		Entries: []types.ChangeMessageVisibilityBatchRequestEntry{
			{
				Id:                ptr.String("__Id__"),
				ReceiptHandle:     ptr.String("__ReceiptHandle__"),
				VisibilityTimeout: 1,
			},
			{
				Id:                ptr.String("__Id__"),
				ReceiptHandle:     ptr.String("__ReceiptHandle__"),
				VisibilityTimeout: 1,
			},
		},
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.ChangeMessageVisibilityBatch(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeUpdateSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "ChangeMessageVisibilityBatch"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_CreateQueue(t *testing.T) {
	input := &CreateQueueInput{
		QueueName: ptr.String("__QueueName__"),
		Attributes: map[string]string{
			"key0": "__Value__",
		},
		Tags: map[string]string{
			"key0": "__Value__",
		},
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.CreateQueue(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeUpdateSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "CreateQueue"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_DeleteMessage(t *testing.T) {
	input := &DeleteMessageInput{
		QueueUrl:      ptr.String("__QueueUrl__"),
		ReceiptHandle: ptr.String("__ReceiptHandle__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.DeleteMessage(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeUpdateSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "DeleteMessage"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_DeleteMessageBatch(t *testing.T) {
	input := &DeleteMessageBatchInput{
		QueueUrl: ptr.String("__QueueUrl__"),
		Entries: []types.DeleteMessageBatchRequestEntry{
			{
				Id:            ptr.String("__Id__"),
				ReceiptHandle: ptr.String("__ReceiptHandle__"),
			},
			{
				Id:            ptr.String("__Id__"),
				ReceiptHandle: ptr.String("__ReceiptHandle__"),
			},
		},
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.DeleteMessageBatch(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeUpdateSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "DeleteMessageBatch"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_DeleteQueue(t *testing.T) {
	input := &DeleteQueueInput{
		QueueUrl: ptr.String("__QueueUrl__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.DeleteQueue(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeUpdateSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "DeleteQueue"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_GetQueueAttributes(t *testing.T) {
	input := &GetQueueAttributesInput{
		QueueUrl: ptr.String("__QueueUrl__"),
		AttributeNames: []types.QueueAttributeName{
			types.QueueAttributeName("All"),
			types.QueueAttributeName("All"),
		},
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.GetQueueAttributes(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeUpdateSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "GetQueueAttributes"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_GetQueueUrl(t *testing.T) {
	input := &GetQueueUrlInput{
		QueueName:              ptr.String("__QueueName__"),
		QueueOwnerAWSAccountId: ptr.String("__QueueOwnerAWSAccountId__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.GetQueueUrl(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeUpdateSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "GetQueueUrl"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_ListDeadLetterSourceQueues(t *testing.T) {
	input := &ListDeadLetterSourceQueuesInput{
		QueueUrl:   ptr.String("__QueueUrl__"),
		NextToken:  ptr.String("__NextToken__"),
		MaxResults: ptr.Int32(1),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.ListDeadLetterSourceQueues(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeUpdateSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "ListDeadLetterSourceQueues"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_ListMessageMoveTasks(t *testing.T) {
	input := &ListMessageMoveTasksInput{
		SourceArn:  ptr.String("__SourceArn__"),
		MaxResults: ptr.Int32(1),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.ListMessageMoveTasks(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeUpdateSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "ListMessageMoveTasks"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_ListQueues(t *testing.T) {
	input := &ListQueuesInput{
		QueueNamePrefix: ptr.String("__QueueNamePrefix__"),
		NextToken:       ptr.String("__NextToken__"),
		MaxResults:      ptr.Int32(1),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.ListQueues(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeUpdateSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "ListQueues"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_ListQueueTags(t *testing.T) {
	input := &ListQueueTagsInput{
		QueueUrl: ptr.String("__QueueUrl__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.ListQueueTags(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeUpdateSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "ListQueueTags"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_PurgeQueue(t *testing.T) {
	input := &PurgeQueueInput{
		QueueUrl: ptr.String("__QueueUrl__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.PurgeQueue(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeUpdateSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "PurgeQueue"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_ReceiveMessage(t *testing.T) {
	input := &ReceiveMessageInput{
		QueueUrl: ptr.String("__QueueUrl__"),
		AttributeNames: []types.QueueAttributeName{
			types.QueueAttributeName("All"),
			types.QueueAttributeName("All"),
		},
		MessageSystemAttributeNames: []types.MessageSystemAttributeName{
			types.MessageSystemAttributeName("All"),
			types.MessageSystemAttributeName("All"),
		},
		MessageAttributeNames: []string{
			"__Member__",
			"__Member__",
		},
		MaxNumberOfMessages:     1,
		VisibilityTimeout:       1,
		WaitTimeSeconds:         1,
		ReceiveRequestAttemptId: ptr.String("__ReceiveRequestAttemptId__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.ReceiveMessage(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeUpdateSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "ReceiveMessage"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_RemovePermission(t *testing.T) {
	input := &RemovePermissionInput{
		QueueUrl: ptr.String("__QueueUrl__"),
		Label:    ptr.String("__Label__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.RemovePermission(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeUpdateSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "RemovePermission"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_SendMessage(t *testing.T) {
	input := &SendMessageInput{
		QueueUrl:     ptr.String("__QueueUrl__"),
		MessageBody:  ptr.String("__MessageBody__"),
		DelaySeconds: 1,
		MessageAttributes: map[string]types.MessageAttributeValue{
			"key0": {
				StringValue: ptr.String("__StringValue__"),
				BinaryValue: []byte("blob"),
				StringListValues: []string{
					"__Member__",
					"__Member__",
				},
				BinaryListValues: [][]byte{
					[]byte("blob"),
					[]byte("blob"),
				},
				DataType: ptr.String("__DataType__"),
			},
		},
		MessageSystemAttributes: map[string]types.MessageSystemAttributeValue{
			"key0": {
				StringValue: ptr.String("__StringValue__"),
				BinaryValue: []byte("blob"),
				StringListValues: []string{
					"__Member__",
					"__Member__",
				},
				BinaryListValues: [][]byte{
					[]byte("blob"),
					[]byte("blob"),
				},
				DataType: ptr.String("__DataType__"),
			},
		},
		MessageDeduplicationId: ptr.String("__MessageDeduplicationId__"),
		MessageGroupId:         ptr.String("__MessageGroupId__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.SendMessage(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeUpdateSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "SendMessage"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_SendMessageBatch(t *testing.T) {
	input := &SendMessageBatchInput{
		QueueUrl: ptr.String("__QueueUrl__"),
		Entries: []types.SendMessageBatchRequestEntry{
			{
				Id:           ptr.String("__Id__"),
				MessageBody:  ptr.String("__MessageBody__"),
				DelaySeconds: 1,
				MessageAttributes: map[string]types.MessageAttributeValue{
					"key0": {
						StringValue: ptr.String("__StringValue__"),
						BinaryValue: []byte("blob"),
						StringListValues: []string{
							"__Member__",
							"__Member__",
						},
						BinaryListValues: [][]byte{
							[]byte("blob"),
							[]byte("blob"),
						},
						DataType: ptr.String("__DataType__"),
					},
				},
				MessageSystemAttributes: map[string]types.MessageSystemAttributeValue{
					"key0": {
						StringValue: ptr.String("__StringValue__"),
						BinaryValue: []byte("blob"),
						StringListValues: []string{
							"__Member__",
							"__Member__",
						},
						BinaryListValues: [][]byte{
							[]byte("blob"),
							[]byte("blob"),
						},
						DataType: ptr.String("__DataType__"),
					},
				},
				MessageDeduplicationId: ptr.String("__MessageDeduplicationId__"),
				MessageGroupId:         ptr.String("__MessageGroupId__"),
			},
			{
				Id:           ptr.String("__Id__"),
				MessageBody:  ptr.String("__MessageBody__"),
				DelaySeconds: 1,
				MessageAttributes: map[string]types.MessageAttributeValue{
					"key0": {
						StringValue: ptr.String("__StringValue__"),
						BinaryValue: []byte("blob"),
						StringListValues: []string{
							"__Member__",
							"__Member__",
						},
						BinaryListValues: [][]byte{
							[]byte("blob"),
							[]byte("blob"),
						},
						DataType: ptr.String("__DataType__"),
					},
				},
				MessageSystemAttributes: map[string]types.MessageSystemAttributeValue{
					"key0": {
						StringValue: ptr.String("__StringValue__"),
						BinaryValue: []byte("blob"),
						StringListValues: []string{
							"__Member__",
							"__Member__",
						},
						BinaryListValues: [][]byte{
							[]byte("blob"),
							[]byte("blob"),
						},
						DataType: ptr.String("__DataType__"),
					},
				},
				MessageDeduplicationId: ptr.String("__MessageDeduplicationId__"),
				MessageGroupId:         ptr.String("__MessageGroupId__"),
			},
		},
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.SendMessageBatch(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeUpdateSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "SendMessageBatch"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_SetQueueAttributes(t *testing.T) {
	input := &SetQueueAttributesInput{
		QueueUrl: ptr.String("__QueueUrl__"),
		Attributes: map[string]string{
			"key0": "__Value__",
		},
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.SetQueueAttributes(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeUpdateSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "SetQueueAttributes"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_StartMessageMoveTask(t *testing.T) {
	input := &StartMessageMoveTaskInput{
		SourceArn:                    ptr.String("__SourceArn__"),
		DestinationArn:               ptr.String("__DestinationArn__"),
		MaxNumberOfMessagesPerSecond: ptr.Int32(1),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.StartMessageMoveTask(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeUpdateSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "StartMessageMoveTask"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_TagQueue(t *testing.T) {
	input := &TagQueueInput{
		QueueUrl: ptr.String("__QueueUrl__"),
		Tags: map[string]string{
			"key0": "__Value__",
		},
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.TagQueue(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeUpdateSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "TagQueue"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_UntagQueue(t *testing.T) {
	input := &UntagQueueInput{
		QueueUrl: ptr.String("__QueueUrl__"),
		TagKeys: []string{
			"__Member__",
			"__Member__",
		},
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.UntagQueue(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeUpdateSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "UntagQueue"); err != nil {
		t.Fatal(err)
	}
}
