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

//go:build response_snapshot

package query

import (
	"bufio"
	"bytes"
	"context"
	"errors"
	"fmt"
	"github.com/aws/aws-sdk-go-v2/internal/protocoltest/query/types"
	smithyendpoints "github.com/aws/smithy-go/endpoints"
	"github.com/aws/smithy-go/middleware"
	"github.com/aws/smithy-go/ptr"
	smithytesting "github.com/aws/smithy-go/testing"
	smithyhttp "github.com/aws/smithy-go/transport/http"
	"io"
	"io/fs"
	"net/http"
	"net/url"
	"os"
	"strconv"
	"strings"
	"testing"
	"time"
)

const serdeRespSSPrefix = "response_snapshot"

func serdeRespSSPath(op string) string {
	return fmt.Sprintf("%s/%s.snap", serdeRespSSPrefix, op)
}

// serdeRespReadSnapshot parses a frozen wire response fixture: a status-code
// line, HTTP headers, a blank line, then the raw body.
func serdeRespReadSnapshot(op string) (int, http.Header, []byte, error) {
	raw, err := os.ReadFile(serdeRespSSPath(op))
	if err != nil {
		return 0, nil, nil, err
	}

	r := bufio.NewReader(bytes.NewReader(raw))
	statusLine, err := r.ReadString('\n')
	if err != nil {
		return 0, nil, nil, fmt.Errorf("read status line: %w", err)
	}
	status, err := strconv.Atoi(strings.TrimSpace(statusLine))
	if err != nil {
		return 0, nil, nil, fmt.Errorf("parse status: %w", err)
	}

	header := http.Header{}
	for {
		line, err := r.ReadString('\n')
		if err != nil && err != io.EOF {
			return 0, nil, nil, err
		}
		trimmed := strings.TrimRight(line, "\r\n")
		if trimmed == "" {
			break
		}
		k, v, ok := strings.Cut(trimmed, ": ")
		if !ok {
			return 0, nil, nil, fmt.Errorf("malformed header %q", trimmed)
		}
		header.Add(k, v)
		if err == io.EOF {
			break
		}
	}

	body, err := io.ReadAll(r)
	if err != nil {
		return 0, nil, nil, err
	}
	return status, header, body, nil
}

type serdeRespEndpointResolver struct{}

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

func serdeRespClient(status int, header http.Header, body []byte) *Client {
	return New(Options{
		Region: "us-east-1",
		HTTPClient: smithyhttp.ClientDoFunc(func(req *http.Request) (*http.Response, error) {
			resp := &http.Response{StatusCode: status, Header: header, Request: req}
			if len(body) > 0 {
				resp.ContentLength = int64(len(body))
				resp.Body = io.NopCloser(bytes.NewReader(body))
			} else {
				resp.Body = http.NoBody
			}
			return resp, nil
		}),
		EndpointResolverV2: &serdeRespEndpointResolver{},
		APIOptions: []func(*middleware.Stack) error{
			func(s *middleware.Stack) error {
				s.Finalize.Clear()
				s.Initialize.Remove("OperationInputValidation")
				return nil
			},
		},
	})
}
func TestCheckResponseSnapshot_DatetimeOffsets(t *testing.T) {
	want := &DatetimeOffsetsOutput{
		Datetime: ptr.Time(time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)),
	}
	status, header, body, err := serdeRespReadSnapshot("DatetimeOffsets.response")
	if errors.Is(err, fs.ErrNotExist) {
		t.Skip("no response snapshot fixture")
	}
	if err != nil {
		t.Fatal(err)
	}
	svc := serdeRespClient(status, header, body)
	got, err := svc.DatetimeOffsets(context.Background(), &DatetimeOffsetsInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "DatetimeOffsets.response", err)
	}
}

func TestCheckResponseSnapshot_EmptyInputAndEmptyOutput(t *testing.T) {
	want := &EmptyInputAndEmptyOutputOutput{}
	status, header, body, err := serdeRespReadSnapshot("EmptyInputAndEmptyOutput.response")
	if errors.Is(err, fs.ErrNotExist) {
		t.Skip("no response snapshot fixture")
	}
	if err != nil {
		t.Fatal(err)
	}
	svc := serdeRespClient(status, header, body)
	got, err := svc.EmptyInputAndEmptyOutput(context.Background(), &EmptyInputAndEmptyOutputInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "EmptyInputAndEmptyOutput.response", err)
	}
}

func TestCheckResponseSnapshot_EndpointOperation(t *testing.T) {
	want := &EndpointOperationOutput{}
	status, header, body, err := serdeRespReadSnapshot("EndpointOperation.response")
	if errors.Is(err, fs.ErrNotExist) {
		t.Skip("no response snapshot fixture")
	}
	if err != nil {
		t.Fatal(err)
	}
	svc := serdeRespClient(status, header, body)
	got, err := svc.EndpointOperation(context.Background(), &EndpointOperationInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "EndpointOperation.response", err)
	}
}

func TestCheckResponseSnapshot_EndpointWithHostLabelOperation(t *testing.T) {
	want := &EndpointWithHostLabelOperationOutput{}
	status, header, body, err := serdeRespReadSnapshot("EndpointWithHostLabelOperation.response")
	if errors.Is(err, fs.ErrNotExist) {
		t.Skip("no response snapshot fixture")
	}
	if err != nil {
		t.Fatal(err)
	}
	svc := serdeRespClient(status, header, body)
	got, err := svc.EndpointWithHostLabelOperation(context.Background(), &EndpointWithHostLabelOperationInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "EndpointWithHostLabelOperation.response", err)
	}
}

func TestCheckResponseSnapshot_FlattenedXmlMap(t *testing.T) {
	want := &FlattenedXmlMapOutput{
		MyMap: map[string]types.FooEnum{
			"key0": types.FooEnum("Foo"),
		},
	}
	status, header, body, err := serdeRespReadSnapshot("FlattenedXmlMap.response")
	if errors.Is(err, fs.ErrNotExist) {
		t.Skip("no response snapshot fixture")
	}
	if err != nil {
		t.Fatal(err)
	}
	svc := serdeRespClient(status, header, body)
	got, err := svc.FlattenedXmlMap(context.Background(), &FlattenedXmlMapInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "FlattenedXmlMap.response", err)
	}
}

func TestCheckResponseSnapshot_FlattenedXmlMapWithXmlName(t *testing.T) {
	want := &FlattenedXmlMapWithXmlNameOutput{
		MyMap: map[string]string{
			"key0": "__Value__",
		},
	}
	status, header, body, err := serdeRespReadSnapshot("FlattenedXmlMapWithXmlName.response")
	if errors.Is(err, fs.ErrNotExist) {
		t.Skip("no response snapshot fixture")
	}
	if err != nil {
		t.Fatal(err)
	}
	svc := serdeRespClient(status, header, body)
	got, err := svc.FlattenedXmlMapWithXmlName(context.Background(), &FlattenedXmlMapWithXmlNameInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "FlattenedXmlMapWithXmlName.response", err)
	}
}

func TestCheckResponseSnapshot_FlattenedXmlMapWithXmlNamespace(t *testing.T) {
	want := &FlattenedXmlMapWithXmlNamespaceOutput{
		MyMap: map[string]string{
			"key0": "__Value__",
		},
	}
	status, header, body, err := serdeRespReadSnapshot("FlattenedXmlMapWithXmlNamespace.response")
	if errors.Is(err, fs.ErrNotExist) {
		t.Skip("no response snapshot fixture")
	}
	if err != nil {
		t.Fatal(err)
	}
	svc := serdeRespClient(status, header, body)
	got, err := svc.FlattenedXmlMapWithXmlNamespace(context.Background(), &FlattenedXmlMapWithXmlNamespaceInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "FlattenedXmlMapWithXmlNamespace.response", err)
	}
}

func TestCheckResponseSnapshot_FractionalSeconds(t *testing.T) {
	want := &FractionalSecondsOutput{
		Datetime: ptr.Time(time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)),
	}
	status, header, body, err := serdeRespReadSnapshot("FractionalSeconds.response")
	if errors.Is(err, fs.ErrNotExist) {
		t.Skip("no response snapshot fixture")
	}
	if err != nil {
		t.Fatal(err)
	}
	svc := serdeRespClient(status, header, body)
	got, err := svc.FractionalSeconds(context.Background(), &FractionalSecondsInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "FractionalSeconds.response", err)
	}
}

func TestCheckResponseSnapshot_GreetingWithErrors(t *testing.T) {
	want := &GreetingWithErrorsOutput{
		Greeting: ptr.String("__Greeting__"),
	}
	status, header, body, err := serdeRespReadSnapshot("GreetingWithErrors.response")
	if errors.Is(err, fs.ErrNotExist) {
		t.Skip("no response snapshot fixture")
	}
	if err != nil {
		t.Fatal(err)
	}
	svc := serdeRespClient(status, header, body)
	got, err := svc.GreetingWithErrors(context.Background(), &GreetingWithErrorsInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "GreetingWithErrors.response", err)
	}
}

func TestCheckResponseSnapshot_HostWithPathOperation(t *testing.T) {
	want := &HostWithPathOperationOutput{}
	status, header, body, err := serdeRespReadSnapshot("HostWithPathOperation.response")
	if errors.Is(err, fs.ErrNotExist) {
		t.Skip("no response snapshot fixture")
	}
	if err != nil {
		t.Fatal(err)
	}
	svc := serdeRespClient(status, header, body)
	got, err := svc.HostWithPathOperation(context.Background(), &HostWithPathOperationInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "HostWithPathOperation.response", err)
	}
}

func TestCheckResponseSnapshot_IgnoresWrappingXmlName(t *testing.T) {
	want := &IgnoresWrappingXmlNameOutput{
		Foo: ptr.String("__Foo__"),
	}
	status, header, body, err := serdeRespReadSnapshot("IgnoresWrappingXmlName.response")
	if errors.Is(err, fs.ErrNotExist) {
		t.Skip("no response snapshot fixture")
	}
	if err != nil {
		t.Fatal(err)
	}
	svc := serdeRespClient(status, header, body)
	got, err := svc.IgnoresWrappingXmlName(context.Background(), &IgnoresWrappingXmlNameInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "IgnoresWrappingXmlName.response", err)
	}
}

func TestCheckResponseSnapshot_NestedStructures(t *testing.T) {
	want := &NestedStructuresOutput{}
	status, header, body, err := serdeRespReadSnapshot("NestedStructures.response")
	if errors.Is(err, fs.ErrNotExist) {
		t.Skip("no response snapshot fixture")
	}
	if err != nil {
		t.Fatal(err)
	}
	svc := serdeRespClient(status, header, body)
	got, err := svc.NestedStructures(context.Background(), &NestedStructuresInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "NestedStructures.response", err)
	}
}

func TestCheckResponseSnapshot_NoInputAndNoOutput(t *testing.T) {
	want := &NoInputAndNoOutputOutput{}
	status, header, body, err := serdeRespReadSnapshot("NoInputAndNoOutput.response")
	if errors.Is(err, fs.ErrNotExist) {
		t.Skip("no response snapshot fixture")
	}
	if err != nil {
		t.Fatal(err)
	}
	svc := serdeRespClient(status, header, body)
	got, err := svc.NoInputAndNoOutput(context.Background(), &NoInputAndNoOutputInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "NoInputAndNoOutput.response", err)
	}
}

func TestCheckResponseSnapshot_NoInputAndOutput(t *testing.T) {
	want := &NoInputAndOutputOutput{}
	status, header, body, err := serdeRespReadSnapshot("NoInputAndOutput.response")
	if errors.Is(err, fs.ErrNotExist) {
		t.Skip("no response snapshot fixture")
	}
	if err != nil {
		t.Fatal(err)
	}
	svc := serdeRespClient(status, header, body)
	got, err := svc.NoInputAndOutput(context.Background(), &NoInputAndOutputInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "NoInputAndOutput.response", err)
	}
}

func TestCheckResponseSnapshot_PutWithContentEncoding(t *testing.T) {
	want := &PutWithContentEncodingOutput{}
	status, header, body, err := serdeRespReadSnapshot("PutWithContentEncoding.response")
	if errors.Is(err, fs.ErrNotExist) {
		t.Skip("no response snapshot fixture")
	}
	if err != nil {
		t.Fatal(err)
	}
	svc := serdeRespClient(status, header, body)
	got, err := svc.PutWithContentEncoding(context.Background(), &PutWithContentEncodingInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "PutWithContentEncoding.response", err)
	}
}

func TestCheckResponseSnapshot_QueryIdempotencyTokenAutoFill(t *testing.T) {
	want := &QueryIdempotencyTokenAutoFillOutput{}
	status, header, body, err := serdeRespReadSnapshot("QueryIdempotencyTokenAutoFill.response")
	if errors.Is(err, fs.ErrNotExist) {
		t.Skip("no response snapshot fixture")
	}
	if err != nil {
		t.Fatal(err)
	}
	svc := serdeRespClient(status, header, body)
	got, err := svc.QueryIdempotencyTokenAutoFill(context.Background(), &QueryIdempotencyTokenAutoFillInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "QueryIdempotencyTokenAutoFill.response", err)
	}
}

func TestCheckResponseSnapshot_QueryLists(t *testing.T) {
	want := &QueryListsOutput{}
	status, header, body, err := serdeRespReadSnapshot("QueryLists.response")
	if errors.Is(err, fs.ErrNotExist) {
		t.Skip("no response snapshot fixture")
	}
	if err != nil {
		t.Fatal(err)
	}
	svc := serdeRespClient(status, header, body)
	got, err := svc.QueryLists(context.Background(), &QueryListsInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "QueryLists.response", err)
	}
}

func TestCheckResponseSnapshot_QueryMaps(t *testing.T) {
	want := &QueryMapsOutput{}
	status, header, body, err := serdeRespReadSnapshot("QueryMaps.response")
	if errors.Is(err, fs.ErrNotExist) {
		t.Skip("no response snapshot fixture")
	}
	if err != nil {
		t.Fatal(err)
	}
	svc := serdeRespClient(status, header, body)
	got, err := svc.QueryMaps(context.Background(), &QueryMapsInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "QueryMaps.response", err)
	}
}

func TestCheckResponseSnapshot_QueryTimestamps(t *testing.T) {
	want := &QueryTimestampsOutput{}
	status, header, body, err := serdeRespReadSnapshot("QueryTimestamps.response")
	if errors.Is(err, fs.ErrNotExist) {
		t.Skip("no response snapshot fixture")
	}
	if err != nil {
		t.Fatal(err)
	}
	svc := serdeRespClient(status, header, body)
	got, err := svc.QueryTimestamps(context.Background(), &QueryTimestampsInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "QueryTimestamps.response", err)
	}
}

func TestCheckResponseSnapshot_RecursiveXmlShapes(t *testing.T) {
	want := &RecursiveXmlShapesOutput{
		Nested: &types.RecursiveXmlShapesOutputNested1{
			Foo: ptr.String("__Foo__"),
			Nested: &types.RecursiveXmlShapesOutputNested2{
				Bar:             ptr.String("__Bar__"),
				RecursiveMember: nil,
			},
		},
	}
	status, header, body, err := serdeRespReadSnapshot("RecursiveXmlShapes.response")
	if errors.Is(err, fs.ErrNotExist) {
		t.Skip("no response snapshot fixture")
	}
	if err != nil {
		t.Fatal(err)
	}
	svc := serdeRespClient(status, header, body)
	got, err := svc.RecursiveXmlShapes(context.Background(), &RecursiveXmlShapesInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "RecursiveXmlShapes.response", err)
	}
}

func TestCheckResponseSnapshot_SimpleInputParams(t *testing.T) {
	want := &SimpleInputParamsOutput{}
	status, header, body, err := serdeRespReadSnapshot("SimpleInputParams.response")
	if errors.Is(err, fs.ErrNotExist) {
		t.Skip("no response snapshot fixture")
	}
	if err != nil {
		t.Fatal(err)
	}
	svc := serdeRespClient(status, header, body)
	got, err := svc.SimpleInputParams(context.Background(), &SimpleInputParamsInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "SimpleInputParams.response", err)
	}
}

func TestCheckResponseSnapshot_SimpleScalarXmlProperties(t *testing.T) {
	want := &SimpleScalarXmlPropertiesOutput{
		StringValue:       ptr.String("__StringValue__"),
		EmptyStringValue:  ptr.String("__EmptyStringValue__"),
		TrueBooleanValue:  ptr.Bool(true),
		FalseBooleanValue: ptr.Bool(true),
		ByteValue:         ptr.Int8(1),
		ShortValue:        ptr.Int16(1),
		IntegerValue:      ptr.Int32(1),
		LongValue:         ptr.Int64(1),
		FloatValue:        ptr.Float32(1.0),
		DoubleValue:       ptr.Float64(1.0),
	}
	status, header, body, err := serdeRespReadSnapshot("SimpleScalarXmlProperties.response")
	if errors.Is(err, fs.ErrNotExist) {
		t.Skip("no response snapshot fixture")
	}
	if err != nil {
		t.Fatal(err)
	}
	svc := serdeRespClient(status, header, body)
	got, err := svc.SimpleScalarXmlProperties(context.Background(), &SimpleScalarXmlPropertiesInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "SimpleScalarXmlProperties.response", err)
	}
}

func TestCheckResponseSnapshot_XmlBlobs(t *testing.T) {
	want := &XmlBlobsOutput{
		Data: []byte("blob"),
	}
	status, header, body, err := serdeRespReadSnapshot("XmlBlobs.response")
	if errors.Is(err, fs.ErrNotExist) {
		t.Skip("no response snapshot fixture")
	}
	if err != nil {
		t.Fatal(err)
	}
	svc := serdeRespClient(status, header, body)
	got, err := svc.XmlBlobs(context.Background(), &XmlBlobsInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "XmlBlobs.response", err)
	}
}

func TestCheckResponseSnapshot_XmlEmptyBlobs(t *testing.T) {
	want := &XmlEmptyBlobsOutput{
		Data: []byte("blob"),
	}
	status, header, body, err := serdeRespReadSnapshot("XmlEmptyBlobs.response")
	if errors.Is(err, fs.ErrNotExist) {
		t.Skip("no response snapshot fixture")
	}
	if err != nil {
		t.Fatal(err)
	}
	svc := serdeRespClient(status, header, body)
	got, err := svc.XmlEmptyBlobs(context.Background(), &XmlEmptyBlobsInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "XmlEmptyBlobs.response", err)
	}
}

func TestCheckResponseSnapshot_XmlEmptyLists(t *testing.T) {
	want := &XmlEmptyListsOutput{
		StringList: []string{
			"__Member__",
			"__Member__",
		},
		StringSet: []string{
			"__Member__",
			"__Member__",
		},
		IntegerList: []int32{
			1,
			1,
		},
		BooleanList: []bool{
			true,
			true,
		},
		TimestampList: []time.Time{
			time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC),
			time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC),
		},
		EnumList: []types.FooEnum{
			types.FooEnum("Foo"),
			types.FooEnum("Foo"),
		},
		IntEnumList: []types.IntegerEnum{
			types.IntegerEnum(1),
			types.IntegerEnum(1),
		},
		NestedStringList: [][]string{
			{
				"__Member__",
				"__Member__",
			},
			{
				"__Member__",
				"__Member__",
			},
		},
		RenamedListMembers: []string{
			"__Member__",
			"__Member__",
		},
		FlattenedList: []string{
			"__Member__",
			"__Member__",
		},
		FlattenedList2: []string{
			"__Member__",
			"__Member__",
		},
		FlattenedListWithMemberNamespace: []string{
			"__Member__",
			"__Member__",
		},
		FlattenedListWithNamespace: []string{
			"__Member__",
			"__Member__",
		},
		StructureList: []types.StructureListMember{
			{
				A: ptr.String("__A__"),
				B: ptr.String("__B__"),
			},
			{
				A: ptr.String("__A__"),
				B: ptr.String("__B__"),
			},
		},
	}
	status, header, body, err := serdeRespReadSnapshot("XmlEmptyLists.response")
	if errors.Is(err, fs.ErrNotExist) {
		t.Skip("no response snapshot fixture")
	}
	if err != nil {
		t.Fatal(err)
	}
	svc := serdeRespClient(status, header, body)
	got, err := svc.XmlEmptyLists(context.Background(), &XmlEmptyListsInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "XmlEmptyLists.response", err)
	}
}

func TestCheckResponseSnapshot_XmlEmptyMaps(t *testing.T) {
	want := &XmlEmptyMapsOutput{
		MyMap: map[string]types.GreetingStruct{
			"key0": {
				Hi: ptr.String("__Hi__"),
			},
		},
	}
	status, header, body, err := serdeRespReadSnapshot("XmlEmptyMaps.response")
	if errors.Is(err, fs.ErrNotExist) {
		t.Skip("no response snapshot fixture")
	}
	if err != nil {
		t.Fatal(err)
	}
	svc := serdeRespClient(status, header, body)
	got, err := svc.XmlEmptyMaps(context.Background(), &XmlEmptyMapsInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "XmlEmptyMaps.response", err)
	}
}

func TestCheckResponseSnapshot_XmlEnums(t *testing.T) {
	want := &XmlEnumsOutput{
		FooEnum1: types.FooEnum("Foo"),
		FooEnum2: types.FooEnum("Foo"),
		FooEnum3: types.FooEnum("Foo"),
		FooEnumList: []types.FooEnum{
			types.FooEnum("Foo"),
			types.FooEnum("Foo"),
		},
		FooEnumSet: []types.FooEnum{
			types.FooEnum("Foo"),
			types.FooEnum("Foo"),
		},
		FooEnumMap: map[string]types.FooEnum{
			"key0": types.FooEnum("Foo"),
		},
	}
	status, header, body, err := serdeRespReadSnapshot("XmlEnums.response")
	if errors.Is(err, fs.ErrNotExist) {
		t.Skip("no response snapshot fixture")
	}
	if err != nil {
		t.Fatal(err)
	}
	svc := serdeRespClient(status, header, body)
	got, err := svc.XmlEnums(context.Background(), &XmlEnumsInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "XmlEnums.response", err)
	}
}

func TestCheckResponseSnapshot_XmlIntEnums(t *testing.T) {
	want := &XmlIntEnumsOutput{
		IntEnum1: types.IntegerEnum(1),
		IntEnum2: types.IntegerEnum(1),
		IntEnum3: types.IntegerEnum(1),
		IntEnumList: []types.IntegerEnum{
			types.IntegerEnum(1),
			types.IntegerEnum(1),
		},
		IntEnumSet: []types.IntegerEnum{
			types.IntegerEnum(1),
			types.IntegerEnum(1),
		},
		IntEnumMap: map[string]types.IntegerEnum{
			"key0": types.IntegerEnum(1),
		},
	}
	status, header, body, err := serdeRespReadSnapshot("XmlIntEnums.response")
	if errors.Is(err, fs.ErrNotExist) {
		t.Skip("no response snapshot fixture")
	}
	if err != nil {
		t.Fatal(err)
	}
	svc := serdeRespClient(status, header, body)
	got, err := svc.XmlIntEnums(context.Background(), &XmlIntEnumsInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "XmlIntEnums.response", err)
	}
}

func TestCheckResponseSnapshot_XmlLists(t *testing.T) {
	want := &XmlListsOutput{
		StringList: []string{
			"__Member__",
			"__Member__",
		},
		StringSet: []string{
			"__Member__",
			"__Member__",
		},
		IntegerList: []int32{
			1,
			1,
		},
		BooleanList: []bool{
			true,
			true,
		},
		TimestampList: []time.Time{
			time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC),
			time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC),
		},
		EnumList: []types.FooEnum{
			types.FooEnum("Foo"),
			types.FooEnum("Foo"),
		},
		IntEnumList: []types.IntegerEnum{
			types.IntegerEnum(1),
			types.IntegerEnum(1),
		},
		NestedStringList: [][]string{
			{
				"__Member__",
				"__Member__",
			},
			{
				"__Member__",
				"__Member__",
			},
		},
		RenamedListMembers: []string{
			"__Member__",
			"__Member__",
		},
		FlattenedList: []string{
			"__Member__",
			"__Member__",
		},
		FlattenedList2: []string{
			"__Member__",
			"__Member__",
		},
		FlattenedListWithMemberNamespace: []string{
			"__Member__",
			"__Member__",
		},
		FlattenedListWithNamespace: []string{
			"__Member__",
			"__Member__",
		},
		StructureList: []types.StructureListMember{
			{
				A: ptr.String("__A__"),
				B: ptr.String("__B__"),
			},
			{
				A: ptr.String("__A__"),
				B: ptr.String("__B__"),
			},
		},
	}
	status, header, body, err := serdeRespReadSnapshot("XmlLists.response")
	if errors.Is(err, fs.ErrNotExist) {
		t.Skip("no response snapshot fixture")
	}
	if err != nil {
		t.Fatal(err)
	}
	svc := serdeRespClient(status, header, body)
	got, err := svc.XmlLists(context.Background(), &XmlListsInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "XmlLists.response", err)
	}
}

func TestCheckResponseSnapshot_XmlMaps(t *testing.T) {
	want := &XmlMapsOutput{
		MyMap: map[string]types.GreetingStruct{
			"key0": {
				Hi: ptr.String("__Hi__"),
			},
		},
	}
	status, header, body, err := serdeRespReadSnapshot("XmlMaps.response")
	if errors.Is(err, fs.ErrNotExist) {
		t.Skip("no response snapshot fixture")
	}
	if err != nil {
		t.Fatal(err)
	}
	svc := serdeRespClient(status, header, body)
	got, err := svc.XmlMaps(context.Background(), &XmlMapsInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "XmlMaps.response", err)
	}
}

func TestCheckResponseSnapshot_XmlMapsXmlName(t *testing.T) {
	want := &XmlMapsXmlNameOutput{
		MyMap: map[string]types.GreetingStruct{
			"key0": {
				Hi: ptr.String("__Hi__"),
			},
		},
	}
	status, header, body, err := serdeRespReadSnapshot("XmlMapsXmlName.response")
	if errors.Is(err, fs.ErrNotExist) {
		t.Skip("no response snapshot fixture")
	}
	if err != nil {
		t.Fatal(err)
	}
	svc := serdeRespClient(status, header, body)
	got, err := svc.XmlMapsXmlName(context.Background(), &XmlMapsXmlNameInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "XmlMapsXmlName.response", err)
	}
}

func TestCheckResponseSnapshot_XmlNamespaces(t *testing.T) {
	want := &XmlNamespacesOutput{
		Nested: &types.XmlNamespaceNested{
			Foo: ptr.String("__Foo__"),
			Values: []string{
				"__Member__",
				"__Member__",
			},
		},
	}
	status, header, body, err := serdeRespReadSnapshot("XmlNamespaces.response")
	if errors.Is(err, fs.ErrNotExist) {
		t.Skip("no response snapshot fixture")
	}
	if err != nil {
		t.Fatal(err)
	}
	svc := serdeRespClient(status, header, body)
	got, err := svc.XmlNamespaces(context.Background(), &XmlNamespacesInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "XmlNamespaces.response", err)
	}
}

func TestCheckResponseSnapshot_XmlTimestamps(t *testing.T) {
	want := &XmlTimestampsOutput{
		Normal:               ptr.Time(time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)),
		DateTime:             ptr.Time(time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)),
		DateTimeOnTarget:     ptr.Time(time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)),
		EpochSeconds:         ptr.Time(time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)),
		EpochSecondsOnTarget: ptr.Time(time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)),
		HttpDate:             ptr.Time(time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)),
		HttpDateOnTarget:     ptr.Time(time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)),
	}
	status, header, body, err := serdeRespReadSnapshot("XmlTimestamps.response")
	if errors.Is(err, fs.ErrNotExist) {
		t.Skip("no response snapshot fixture")
	}
	if err != nil {
		t.Fatal(err)
	}
	svc := serdeRespClient(status, header, body)
	got, err := svc.XmlTimestamps(context.Background(), &XmlTimestampsInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "XmlTimestamps.response", err)
	}
}

func TestCheckResponseSnapshot_Error_ComplexError(t *testing.T) {
	want := &types.ComplexError{
		TopLevel: ptr.String("__TopLevel__"),
		Nested: &types.ComplexNestedErrorData{
			Foo: ptr.String("__Foo__"),
		},
	}
	status, header, body, err := serdeRespReadSnapshot("ComplexError.error")
	if errors.Is(err, fs.ErrNotExist) {
		t.Skip("no response snapshot fixture")
	}
	if err != nil {
		t.Fatal(err)
	}
	svc := serdeRespClient(status, header, body)
	_, opErr := svc.GreetingWithErrors(context.Background(), &GreetingWithErrorsInput{})
	if opErr == nil {
		t.Fatal("expected error, got nil")
	}
	var got *types.ComplexError
	if !errors.As(opErr, &got) {
		t.Fatalf("expected types.ComplexError, got %v", opErr)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("error response snapshot mismatch for %s: %v", "ComplexError.error", err)
	}
}

func TestCheckResponseSnapshot_Error_CustomCodeError(t *testing.T) {
	want := &types.CustomCodeError{
		Message: ptr.String("__Message__"),
	}
	status, header, body, err := serdeRespReadSnapshot("CustomCodeError.error")
	if errors.Is(err, fs.ErrNotExist) {
		t.Skip("no response snapshot fixture")
	}
	if err != nil {
		t.Fatal(err)
	}
	svc := serdeRespClient(status, header, body)
	_, opErr := svc.GreetingWithErrors(context.Background(), &GreetingWithErrorsInput{})
	if opErr == nil {
		t.Fatal("expected error, got nil")
	}
	var got *types.CustomCodeError
	if !errors.As(opErr, &got) {
		t.Fatalf("expected types.CustomCodeError, got %v", opErr)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("error response snapshot mismatch for %s: %v", "CustomCodeError.error", err)
	}
}

func TestCheckResponseSnapshot_Error_InvalidGreeting(t *testing.T) {
	want := &types.InvalidGreeting{
		Message: ptr.String("__Message__"),
	}
	status, header, body, err := serdeRespReadSnapshot("InvalidGreeting.error")
	if errors.Is(err, fs.ErrNotExist) {
		t.Skip("no response snapshot fixture")
	}
	if err != nil {
		t.Fatal(err)
	}
	svc := serdeRespClient(status, header, body)
	_, opErr := svc.GreetingWithErrors(context.Background(), &GreetingWithErrorsInput{})
	if opErr == nil {
		t.Fatal("expected error, got nil")
	}
	var got *types.InvalidGreeting
	if !errors.As(opErr, &got) {
		t.Fatalf("expected types.InvalidGreeting, got %v", opErr)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("error response snapshot mismatch for %s: %v", "InvalidGreeting.error", err)
	}
}
