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

//go:build response_snapshot

package cloudcontrol

import (
	"bufio"
	"bytes"
	"context"
	"errors"
	"fmt"
	"github.com/aws/aws-sdk-go-v2/service/cloudcontrol/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_CancelResourceRequest(t *testing.T) {
	want := &CancelResourceRequestOutput{
		ProgressEvent: &types.ProgressEvent{
			TypeName:          ptr.String("__TypeName__"),
			Identifier:        ptr.String("__Identifier__"),
			RequestToken:      ptr.String("__RequestToken__"),
			HooksRequestToken: ptr.String("__HooksRequestToken__"),
			Operation:         types.Operation("CREATE"),
			OperationStatus:   types.OperationStatus("PENDING"),
			EventTime:         ptr.Time(time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)),
			ResourceModel:     ptr.String("__ResourceModel__"),
			StatusMessage:     ptr.String("__StatusMessage__"),
			ErrorCode:         types.HandlerErrorCode("NotUpdatable"),
			RetryAfter:        ptr.Time(time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)),
		},
	}
	status, header, body, err := serdeRespReadSnapshot("CancelResourceRequest.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.CancelResourceRequest(context.Background(), &CancelResourceRequestInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "CancelResourceRequest.response", err)
	}
}

func TestCheckResponseSnapshot_CreateResource(t *testing.T) {
	want := &CreateResourceOutput{
		ProgressEvent: &types.ProgressEvent{
			TypeName:          ptr.String("__TypeName__"),
			Identifier:        ptr.String("__Identifier__"),
			RequestToken:      ptr.String("__RequestToken__"),
			HooksRequestToken: ptr.String("__HooksRequestToken__"),
			Operation:         types.Operation("CREATE"),
			OperationStatus:   types.OperationStatus("PENDING"),
			EventTime:         ptr.Time(time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)),
			ResourceModel:     ptr.String("__ResourceModel__"),
			StatusMessage:     ptr.String("__StatusMessage__"),
			ErrorCode:         types.HandlerErrorCode("NotUpdatable"),
			RetryAfter:        ptr.Time(time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)),
		},
	}
	status, header, body, err := serdeRespReadSnapshot("CreateResource.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.CreateResource(context.Background(), &CreateResourceInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "CreateResource.response", err)
	}
}

func TestCheckResponseSnapshot_DeleteResource(t *testing.T) {
	want := &DeleteResourceOutput{
		ProgressEvent: &types.ProgressEvent{
			TypeName:          ptr.String("__TypeName__"),
			Identifier:        ptr.String("__Identifier__"),
			RequestToken:      ptr.String("__RequestToken__"),
			HooksRequestToken: ptr.String("__HooksRequestToken__"),
			Operation:         types.Operation("CREATE"),
			OperationStatus:   types.OperationStatus("PENDING"),
			EventTime:         ptr.Time(time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)),
			ResourceModel:     ptr.String("__ResourceModel__"),
			StatusMessage:     ptr.String("__StatusMessage__"),
			ErrorCode:         types.HandlerErrorCode("NotUpdatable"),
			RetryAfter:        ptr.Time(time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)),
		},
	}
	status, header, body, err := serdeRespReadSnapshot("DeleteResource.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.DeleteResource(context.Background(), &DeleteResourceInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "DeleteResource.response", err)
	}
}

func TestCheckResponseSnapshot_GetResource(t *testing.T) {
	want := &GetResourceOutput{
		TypeName: ptr.String("__TypeName__"),
		ResourceDescription: &types.ResourceDescription{
			Identifier: ptr.String("__Identifier__"),
			Properties: ptr.String("__Properties__"),
		},
	}
	status, header, body, err := serdeRespReadSnapshot("GetResource.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.GetResource(context.Background(), &GetResourceInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "GetResource.response", err)
	}
}

func TestCheckResponseSnapshot_GetResourceRequestStatus(t *testing.T) {
	want := &GetResourceRequestStatusOutput{
		ProgressEvent: &types.ProgressEvent{
			TypeName:          ptr.String("__TypeName__"),
			Identifier:        ptr.String("__Identifier__"),
			RequestToken:      ptr.String("__RequestToken__"),
			HooksRequestToken: ptr.String("__HooksRequestToken__"),
			Operation:         types.Operation("CREATE"),
			OperationStatus:   types.OperationStatus("PENDING"),
			EventTime:         ptr.Time(time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)),
			ResourceModel:     ptr.String("__ResourceModel__"),
			StatusMessage:     ptr.String("__StatusMessage__"),
			ErrorCode:         types.HandlerErrorCode("NotUpdatable"),
			RetryAfter:        ptr.Time(time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)),
		},
		HooksProgressEvent: []types.HookProgressEvent{
			{
				HookTypeName:      ptr.String("__HookTypeName__"),
				HookTypeVersionId: ptr.String("__HookTypeVersionId__"),
				HookTypeArn:       ptr.String("__HookTypeArn__"),
				InvocationPoint:   ptr.String("__InvocationPoint__"),
				HookStatus:        ptr.String("__HookStatus__"),
				HookEventTime:     ptr.Time(time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)),
				HookStatusMessage: ptr.String("__HookStatusMessage__"),
				FailureMode:       ptr.String("__FailureMode__"),
			},
			{
				HookTypeName:      ptr.String("__HookTypeName__"),
				HookTypeVersionId: ptr.String("__HookTypeVersionId__"),
				HookTypeArn:       ptr.String("__HookTypeArn__"),
				InvocationPoint:   ptr.String("__InvocationPoint__"),
				HookStatus:        ptr.String("__HookStatus__"),
				HookEventTime:     ptr.Time(time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)),
				HookStatusMessage: ptr.String("__HookStatusMessage__"),
				FailureMode:       ptr.String("__FailureMode__"),
			},
		},
	}
	status, header, body, err := serdeRespReadSnapshot("GetResourceRequestStatus.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.GetResourceRequestStatus(context.Background(), &GetResourceRequestStatusInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "GetResourceRequestStatus.response", err)
	}
}

func TestCheckResponseSnapshot_ListResourceRequests(t *testing.T) {
	want := &ListResourceRequestsOutput{
		ResourceRequestStatusSummaries: []types.ProgressEvent{
			{
				TypeName:          ptr.String("__TypeName__"),
				Identifier:        ptr.String("__Identifier__"),
				RequestToken:      ptr.String("__RequestToken__"),
				HooksRequestToken: ptr.String("__HooksRequestToken__"),
				Operation:         types.Operation("CREATE"),
				OperationStatus:   types.OperationStatus("PENDING"),
				EventTime:         ptr.Time(time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)),
				ResourceModel:     ptr.String("__ResourceModel__"),
				StatusMessage:     ptr.String("__StatusMessage__"),
				ErrorCode:         types.HandlerErrorCode("NotUpdatable"),
				RetryAfter:        ptr.Time(time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)),
			},
			{
				TypeName:          ptr.String("__TypeName__"),
				Identifier:        ptr.String("__Identifier__"),
				RequestToken:      ptr.String("__RequestToken__"),
				HooksRequestToken: ptr.String("__HooksRequestToken__"),
				Operation:         types.Operation("CREATE"),
				OperationStatus:   types.OperationStatus("PENDING"),
				EventTime:         ptr.Time(time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)),
				ResourceModel:     ptr.String("__ResourceModel__"),
				StatusMessage:     ptr.String("__StatusMessage__"),
				ErrorCode:         types.HandlerErrorCode("NotUpdatable"),
				RetryAfter:        ptr.Time(time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)),
			},
		},
		NextToken: ptr.String("__NextToken__"),
	}
	status, header, body, err := serdeRespReadSnapshot("ListResourceRequests.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.ListResourceRequests(context.Background(), &ListResourceRequestsInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "ListResourceRequests.response", err)
	}
}

func TestCheckResponseSnapshot_ListResources(t *testing.T) {
	want := &ListResourcesOutput{
		TypeName: ptr.String("__TypeName__"),
		ResourceDescriptions: []types.ResourceDescription{
			{
				Identifier: ptr.String("__Identifier__"),
				Properties: ptr.String("__Properties__"),
			},
			{
				Identifier: ptr.String("__Identifier__"),
				Properties: ptr.String("__Properties__"),
			},
		},
		NextToken: ptr.String("__NextToken__"),
	}
	status, header, body, err := serdeRespReadSnapshot("ListResources.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.ListResources(context.Background(), &ListResourcesInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "ListResources.response", err)
	}
}

func TestCheckResponseSnapshot_UpdateResource(t *testing.T) {
	want := &UpdateResourceOutput{
		ProgressEvent: &types.ProgressEvent{
			TypeName:          ptr.String("__TypeName__"),
			Identifier:        ptr.String("__Identifier__"),
			RequestToken:      ptr.String("__RequestToken__"),
			HooksRequestToken: ptr.String("__HooksRequestToken__"),
			Operation:         types.Operation("CREATE"),
			OperationStatus:   types.OperationStatus("PENDING"),
			EventTime:         ptr.Time(time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)),
			ResourceModel:     ptr.String("__ResourceModel__"),
			StatusMessage:     ptr.String("__StatusMessage__"),
			ErrorCode:         types.HandlerErrorCode("NotUpdatable"),
			RetryAfter:        ptr.Time(time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)),
		},
	}
	status, header, body, err := serdeRespReadSnapshot("UpdateResource.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.UpdateResource(context.Background(), &UpdateResourceInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "UpdateResource.response", err)
	}
}

func TestCheckResponseSnapshot_Error_AlreadyExistsException(t *testing.T) {
	want := &types.AlreadyExistsException{
		Message: ptr.String("__Message__"),
	}
	status, header, body, err := serdeRespReadSnapshot("AlreadyExistsException.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.CreateResource(context.Background(), &CreateResourceInput{})
	if opErr == nil {
		t.Fatal("expected error, got nil")
	}
	var got *types.AlreadyExistsException
	if !errors.As(opErr, &got) {
		t.Fatalf("expected types.AlreadyExistsException, got %v", opErr)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("error response snapshot mismatch for %s: %v", "AlreadyExistsException.error", err)
	}
}

func TestCheckResponseSnapshot_Error_ClientTokenConflictException(t *testing.T) {
	want := &types.ClientTokenConflictException{
		Message: ptr.String("__Message__"),
	}
	status, header, body, err := serdeRespReadSnapshot("ClientTokenConflictException.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.CreateResource(context.Background(), &CreateResourceInput{})
	if opErr == nil {
		t.Fatal("expected error, got nil")
	}
	var got *types.ClientTokenConflictException
	if !errors.As(opErr, &got) {
		t.Fatalf("expected types.ClientTokenConflictException, got %v", opErr)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("error response snapshot mismatch for %s: %v", "ClientTokenConflictException.error", err)
	}
}

func TestCheckResponseSnapshot_Error_ConcurrentModificationException(t *testing.T) {
	want := &types.ConcurrentModificationException{
		Message: ptr.String("__Message__"),
	}
	status, header, body, err := serdeRespReadSnapshot("ConcurrentModificationException.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.CancelResourceRequest(context.Background(), &CancelResourceRequestInput{})
	if opErr == nil {
		t.Fatal("expected error, got nil")
	}
	var got *types.ConcurrentModificationException
	if !errors.As(opErr, &got) {
		t.Fatalf("expected types.ConcurrentModificationException, got %v", opErr)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("error response snapshot mismatch for %s: %v", "ConcurrentModificationException.error", err)
	}
}

func TestCheckResponseSnapshot_Error_ConcurrentOperationException(t *testing.T) {
	want := &types.ConcurrentOperationException{
		Message: ptr.String("__Message__"),
	}
	status, header, body, err := serdeRespReadSnapshot("ConcurrentOperationException.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.CreateResource(context.Background(), &CreateResourceInput{})
	if opErr == nil {
		t.Fatal("expected error, got nil")
	}
	var got *types.ConcurrentOperationException
	if !errors.As(opErr, &got) {
		t.Fatalf("expected types.ConcurrentOperationException, got %v", opErr)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("error response snapshot mismatch for %s: %v", "ConcurrentOperationException.error", err)
	}
}

func TestCheckResponseSnapshot_Error_GeneralServiceException(t *testing.T) {
	want := &types.GeneralServiceException{
		Message: ptr.String("__Message__"),
	}
	status, header, body, err := serdeRespReadSnapshot("GeneralServiceException.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.CreateResource(context.Background(), &CreateResourceInput{})
	if opErr == nil {
		t.Fatal("expected error, got nil")
	}
	var got *types.GeneralServiceException
	if !errors.As(opErr, &got) {
		t.Fatalf("expected types.GeneralServiceException, got %v", opErr)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("error response snapshot mismatch for %s: %v", "GeneralServiceException.error", err)
	}
}

func TestCheckResponseSnapshot_Error_HandlerFailureException(t *testing.T) {
	want := &types.HandlerFailureException{
		Message: ptr.String("__Message__"),
	}
	status, header, body, err := serdeRespReadSnapshot("HandlerFailureException.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.CreateResource(context.Background(), &CreateResourceInput{})
	if opErr == nil {
		t.Fatal("expected error, got nil")
	}
	var got *types.HandlerFailureException
	if !errors.As(opErr, &got) {
		t.Fatalf("expected types.HandlerFailureException, got %v", opErr)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("error response snapshot mismatch for %s: %v", "HandlerFailureException.error", err)
	}
}

func TestCheckResponseSnapshot_Error_HandlerInternalFailureException(t *testing.T) {
	want := &types.HandlerInternalFailureException{
		Message: ptr.String("__Message__"),
	}
	status, header, body, err := serdeRespReadSnapshot("HandlerInternalFailureException.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.CreateResource(context.Background(), &CreateResourceInput{})
	if opErr == nil {
		t.Fatal("expected error, got nil")
	}
	var got *types.HandlerInternalFailureException
	if !errors.As(opErr, &got) {
		t.Fatalf("expected types.HandlerInternalFailureException, got %v", opErr)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("error response snapshot mismatch for %s: %v", "HandlerInternalFailureException.error", err)
	}
}

func TestCheckResponseSnapshot_Error_InvalidCredentialsException(t *testing.T) {
	want := &types.InvalidCredentialsException{
		Message: ptr.String("__Message__"),
	}
	status, header, body, err := serdeRespReadSnapshot("InvalidCredentialsException.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.CreateResource(context.Background(), &CreateResourceInput{})
	if opErr == nil {
		t.Fatal("expected error, got nil")
	}
	var got *types.InvalidCredentialsException
	if !errors.As(opErr, &got) {
		t.Fatalf("expected types.InvalidCredentialsException, got %v", opErr)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("error response snapshot mismatch for %s: %v", "InvalidCredentialsException.error", err)
	}
}

func TestCheckResponseSnapshot_Error_InvalidRequestException(t *testing.T) {
	want := &types.InvalidRequestException{
		Message: ptr.String("__Message__"),
	}
	status, header, body, err := serdeRespReadSnapshot("InvalidRequestException.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.CreateResource(context.Background(), &CreateResourceInput{})
	if opErr == nil {
		t.Fatal("expected error, got nil")
	}
	var got *types.InvalidRequestException
	if !errors.As(opErr, &got) {
		t.Fatalf("expected types.InvalidRequestException, got %v", opErr)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("error response snapshot mismatch for %s: %v", "InvalidRequestException.error", err)
	}
}

func TestCheckResponseSnapshot_Error_NetworkFailureException(t *testing.T) {
	want := &types.NetworkFailureException{
		Message: ptr.String("__Message__"),
	}
	status, header, body, err := serdeRespReadSnapshot("NetworkFailureException.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.CreateResource(context.Background(), &CreateResourceInput{})
	if opErr == nil {
		t.Fatal("expected error, got nil")
	}
	var got *types.NetworkFailureException
	if !errors.As(opErr, &got) {
		t.Fatalf("expected types.NetworkFailureException, got %v", opErr)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("error response snapshot mismatch for %s: %v", "NetworkFailureException.error", err)
	}
}

func TestCheckResponseSnapshot_Error_NotStabilizedException(t *testing.T) {
	want := &types.NotStabilizedException{
		Message: ptr.String("__Message__"),
	}
	status, header, body, err := serdeRespReadSnapshot("NotStabilizedException.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.CreateResource(context.Background(), &CreateResourceInput{})
	if opErr == nil {
		t.Fatal("expected error, got nil")
	}
	var got *types.NotStabilizedException
	if !errors.As(opErr, &got) {
		t.Fatalf("expected types.NotStabilizedException, got %v", opErr)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("error response snapshot mismatch for %s: %v", "NotStabilizedException.error", err)
	}
}

func TestCheckResponseSnapshot_Error_NotUpdatableException(t *testing.T) {
	want := &types.NotUpdatableException{
		Message: ptr.String("__Message__"),
	}
	status, header, body, err := serdeRespReadSnapshot("NotUpdatableException.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.CreateResource(context.Background(), &CreateResourceInput{})
	if opErr == nil {
		t.Fatal("expected error, got nil")
	}
	var got *types.NotUpdatableException
	if !errors.As(opErr, &got) {
		t.Fatalf("expected types.NotUpdatableException, got %v", opErr)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("error response snapshot mismatch for %s: %v", "NotUpdatableException.error", err)
	}
}

func TestCheckResponseSnapshot_Error_PrivateTypeException(t *testing.T) {
	want := &types.PrivateTypeException{
		Message: ptr.String("__Message__"),
	}
	status, header, body, err := serdeRespReadSnapshot("PrivateTypeException.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.CreateResource(context.Background(), &CreateResourceInput{})
	if opErr == nil {
		t.Fatal("expected error, got nil")
	}
	var got *types.PrivateTypeException
	if !errors.As(opErr, &got) {
		t.Fatalf("expected types.PrivateTypeException, got %v", opErr)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("error response snapshot mismatch for %s: %v", "PrivateTypeException.error", err)
	}
}

func TestCheckResponseSnapshot_Error_RequestTokenNotFoundException(t *testing.T) {
	want := &types.RequestTokenNotFoundException{
		Message: ptr.String("__Message__"),
	}
	status, header, body, err := serdeRespReadSnapshot("RequestTokenNotFoundException.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.CancelResourceRequest(context.Background(), &CancelResourceRequestInput{})
	if opErr == nil {
		t.Fatal("expected error, got nil")
	}
	var got *types.RequestTokenNotFoundException
	if !errors.As(opErr, &got) {
		t.Fatalf("expected types.RequestTokenNotFoundException, got %v", opErr)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("error response snapshot mismatch for %s: %v", "RequestTokenNotFoundException.error", err)
	}
}

func TestCheckResponseSnapshot_Error_ResourceConflictException(t *testing.T) {
	want := &types.ResourceConflictException{
		Message: ptr.String("__Message__"),
	}
	status, header, body, err := serdeRespReadSnapshot("ResourceConflictException.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.CreateResource(context.Background(), &CreateResourceInput{})
	if opErr == nil {
		t.Fatal("expected error, got nil")
	}
	var got *types.ResourceConflictException
	if !errors.As(opErr, &got) {
		t.Fatalf("expected types.ResourceConflictException, got %v", opErr)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("error response snapshot mismatch for %s: %v", "ResourceConflictException.error", err)
	}
}

func TestCheckResponseSnapshot_Error_ResourceNotFoundException(t *testing.T) {
	want := &types.ResourceNotFoundException{
		Message: ptr.String("__Message__"),
	}
	status, header, body, err := serdeRespReadSnapshot("ResourceNotFoundException.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.CreateResource(context.Background(), &CreateResourceInput{})
	if opErr == nil {
		t.Fatal("expected error, got nil")
	}
	var got *types.ResourceNotFoundException
	if !errors.As(opErr, &got) {
		t.Fatalf("expected types.ResourceNotFoundException, got %v", opErr)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("error response snapshot mismatch for %s: %v", "ResourceNotFoundException.error", err)
	}
}

func TestCheckResponseSnapshot_Error_ServiceInternalErrorException(t *testing.T) {
	want := &types.ServiceInternalErrorException{
		Message: ptr.String("__Message__"),
	}
	status, header, body, err := serdeRespReadSnapshot("ServiceInternalErrorException.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.CreateResource(context.Background(), &CreateResourceInput{})
	if opErr == nil {
		t.Fatal("expected error, got nil")
	}
	var got *types.ServiceInternalErrorException
	if !errors.As(opErr, &got) {
		t.Fatalf("expected types.ServiceInternalErrorException, got %v", opErr)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("error response snapshot mismatch for %s: %v", "ServiceInternalErrorException.error", err)
	}
}

func TestCheckResponseSnapshot_Error_ServiceLimitExceededException(t *testing.T) {
	want := &types.ServiceLimitExceededException{
		Message: ptr.String("__Message__"),
	}
	status, header, body, err := serdeRespReadSnapshot("ServiceLimitExceededException.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.CreateResource(context.Background(), &CreateResourceInput{})
	if opErr == nil {
		t.Fatal("expected error, got nil")
	}
	var got *types.ServiceLimitExceededException
	if !errors.As(opErr, &got) {
		t.Fatalf("expected types.ServiceLimitExceededException, got %v", opErr)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("error response snapshot mismatch for %s: %v", "ServiceLimitExceededException.error", err)
	}
}

func TestCheckResponseSnapshot_Error_ThrottlingException(t *testing.T) {
	want := &types.ThrottlingException{
		Message: ptr.String("__Message__"),
	}
	status, header, body, err := serdeRespReadSnapshot("ThrottlingException.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.CreateResource(context.Background(), &CreateResourceInput{})
	if opErr == nil {
		t.Fatal("expected error, got nil")
	}
	var got *types.ThrottlingException
	if !errors.As(opErr, &got) {
		t.Fatalf("expected types.ThrottlingException, got %v", opErr)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("error response snapshot mismatch for %s: %v", "ThrottlingException.error", err)
	}
}

func TestCheckResponseSnapshot_Error_TypeNotFoundException(t *testing.T) {
	want := &types.TypeNotFoundException{
		Message: ptr.String("__Message__"),
	}
	status, header, body, err := serdeRespReadSnapshot("TypeNotFoundException.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.CreateResource(context.Background(), &CreateResourceInput{})
	if opErr == nil {
		t.Fatal("expected error, got nil")
	}
	var got *types.TypeNotFoundException
	if !errors.As(opErr, &got) {
		t.Fatalf("expected types.TypeNotFoundException, got %v", opErr)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("error response snapshot mismatch for %s: %v", "TypeNotFoundException.error", err)
	}
}

func TestCheckResponseSnapshot_Error_UnsupportedActionException(t *testing.T) {
	want := &types.UnsupportedActionException{
		Message: ptr.String("__Message__"),
	}
	status, header, body, err := serdeRespReadSnapshot("UnsupportedActionException.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.CreateResource(context.Background(), &CreateResourceInput{})
	if opErr == nil {
		t.Fatal("expected error, got nil")
	}
	var got *types.UnsupportedActionException
	if !errors.As(opErr, &got) {
		t.Fatalf("expected types.UnsupportedActionException, got %v", opErr)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("error response snapshot mismatch for %s: %v", "UnsupportedActionException.error", err)
	}
}
