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

//go:build response_snapshot

package billing

import (
	"bufio"
	"bytes"
	"context"
	"errors"
	"fmt"
	"github.com/aws/aws-sdk-go-v2/service/billing/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_AssociateSourceViews(t *testing.T) {
	want := &AssociateSourceViewsOutput{
		Arn: ptr.String("__Arn__"),
	}
	status, header, body, err := serdeRespReadSnapshot("AssociateSourceViews.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.AssociateSourceViews(context.Background(), &AssociateSourceViewsInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "AssociateSourceViews.response", err)
	}
}

func TestCheckResponseSnapshot_CreateBillingView(t *testing.T) {
	want := &CreateBillingViewOutput{
		Arn:       ptr.String("__Arn__"),
		CreatedAt: ptr.Time(time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)),
	}
	status, header, body, err := serdeRespReadSnapshot("CreateBillingView.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.CreateBillingView(context.Background(), &CreateBillingViewInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "CreateBillingView.response", err)
	}
}

func TestCheckResponseSnapshot_DeleteBillingView(t *testing.T) {
	want := &DeleteBillingViewOutput{
		Arn: ptr.String("__Arn__"),
	}
	status, header, body, err := serdeRespReadSnapshot("DeleteBillingView.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.DeleteBillingView(context.Background(), &DeleteBillingViewInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "DeleteBillingView.response", err)
	}
}

func TestCheckResponseSnapshot_DisassociateSourceViews(t *testing.T) {
	want := &DisassociateSourceViewsOutput{
		Arn: ptr.String("__Arn__"),
	}
	status, header, body, err := serdeRespReadSnapshot("DisassociateSourceViews.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.DisassociateSourceViews(context.Background(), &DisassociateSourceViewsInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "DisassociateSourceViews.response", err)
	}
}

func TestCheckResponseSnapshot_GetBillingPreferences(t *testing.T) {
	want := &GetBillingPreferencesOutput{
		BillingPreferences: []types.BillingPreferenceSummary{
			{
				Feature:     types.BillingFeature("RI_SHARING"),
				Key:         ptr.String("__Key__"),
				Value:       types.PreferenceValue("ENABLED"),
				AccountName: ptr.String("__AccountName__"),
				AccountId:   ptr.String("__AccountId__"),
				BillingPeriod: &types.BillingPeriod{
					Year:  ptr.Int32(1),
					Month: ptr.Int32(1),
				},
			},
			{
				Feature:     types.BillingFeature("RI_SHARING"),
				Key:         ptr.String("__Key__"),
				Value:       types.PreferenceValue("ENABLED"),
				AccountName: ptr.String("__AccountName__"),
				AccountId:   ptr.String("__AccountId__"),
				BillingPeriod: &types.BillingPeriod{
					Year:  ptr.Int32(1),
					Month: ptr.Int32(1),
				},
			},
		},
		NextToken: ptr.String("__NextToken__"),
	}
	status, header, body, err := serdeRespReadSnapshot("GetBillingPreferences.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.GetBillingPreferences(context.Background(), &GetBillingPreferencesInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "GetBillingPreferences.response", err)
	}
}

func TestCheckResponseSnapshot_GetBillingView(t *testing.T) {
	want := &GetBillingViewOutput{
		BillingView: &types.BillingViewElement{
			Arn:             ptr.String("__Arn__"),
			Name:            ptr.String("__Name__"),
			Description:     ptr.String("__Description__"),
			BillingViewType: types.BillingViewType("PRIMARY"),
			OwnerAccountId:  ptr.String("__OwnerAccountId__"),
			SourceAccountId: ptr.String("__SourceAccountId__"),
			DataFilterExpression: &types.Expression{
				Dimensions: &types.DimensionValues{
					Key: types.Dimension("LINKED_ACCOUNT"),
					Values: []string{
						"__Member__",
						"__Member__",
					},
				},
				Tags: &types.TagValues{
					Key: ptr.String("__Key__"),
					Values: []string{
						"__Member__",
						"__Member__",
					},
				},
				CostCategories: &types.CostCategoryValues{
					Key: ptr.String("__Key__"),
					Values: []string{
						"__Member__",
						"__Member__",
					},
				},
				TimeRange: &types.TimeRange{
					BeginDateInclusive: ptr.Time(time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)),
					EndDateInclusive:   ptr.Time(time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)),
				},
			},
			CreatedAt:                   ptr.Time(time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)),
			UpdatedAt:                   ptr.Time(time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)),
			DerivedViewCount:            ptr.Int32(1),
			SourceViewCount:             ptr.Int32(1),
			ViewDefinitionLastUpdatedAt: ptr.Time(time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)),
			HealthStatus: &types.BillingViewHealthStatus{
				StatusCode: types.BillingViewStatus("HEALTHY"),
				StatusReasons: []types.BillingViewStatusReason{
					types.BillingViewStatusReason("SOURCE_VIEW_UNHEALTHY"),
					types.BillingViewStatusReason("SOURCE_VIEW_UNHEALTHY"),
				},
			},
		},
	}
	status, header, body, err := serdeRespReadSnapshot("GetBillingView.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.GetBillingView(context.Background(), &GetBillingViewInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "GetBillingView.response", err)
	}
}

func TestCheckResponseSnapshot_GetCreditAllocationHistory(t *testing.T) {
	want := &GetCreditAllocationHistoryOutput{
		CreditAllocationHistoryList: []types.CreditAllocationHistoryEntry{
			{
				CreditId: ptr.String("__CreditId__"),
				CreditAmount: &types.Amount{
					CurrencyCode:   ptr.String("__CurrencyCode__"),
					CurrencyAmount: ptr.String("__CurrencyAmount__"),
				},
				Description:        ptr.String("__Description__"),
				AccountId:          ptr.String("__AccountId__"),
				AppliedServiceName: ptr.String("__AppliedServiceName__"),
				BillingMonth:       ptr.String("__BillingMonth__"),
				IsEstimatedBill:    ptr.Bool(true),
			},
			{
				CreditId: ptr.String("__CreditId__"),
				CreditAmount: &types.Amount{
					CurrencyCode:   ptr.String("__CurrencyCode__"),
					CurrencyAmount: ptr.String("__CurrencyAmount__"),
				},
				Description:        ptr.String("__Description__"),
				AccountId:          ptr.String("__AccountId__"),
				AppliedServiceName: ptr.String("__AppliedServiceName__"),
				BillingMonth:       ptr.String("__BillingMonth__"),
				IsEstimatedBill:    ptr.Bool(true),
			},
		},
		PartialResults: ptr.Bool(true),
		FailedMonths: []string{
			"__Member__",
			"__Member__",
		},
		NextToken: ptr.String("__NextToken__"),
	}
	status, header, body, err := serdeRespReadSnapshot("GetCreditAllocationHistory.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.GetCreditAllocationHistory(context.Background(), &GetCreditAllocationHistoryInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "GetCreditAllocationHistory.response", err)
	}
}

func TestCheckResponseSnapshot_GetCredits(t *testing.T) {
	want := &GetCreditsOutput{
		Credits: []types.CreditData{
			{
				CreditId:   ptr.String("__CreditId__"),
				AccountId:  ptr.String("__AccountId__"),
				CreditType: ptr.String("__CreditType__"),
				InitialAmount: &types.Amount{
					CurrencyCode:   ptr.String("__CurrencyCode__"),
					CurrencyAmount: ptr.String("__CurrencyAmount__"),
				},
				RemainingAmount: &types.Amount{
					CurrencyCode:   ptr.String("__CurrencyCode__"),
					CurrencyAmount: ptr.String("__CurrencyAmount__"),
				},
				EstimatedAmount: &types.Amount{
					CurrencyCode:   ptr.String("__CurrencyCode__"),
					CurrencyAmount: ptr.String("__CurrencyAmount__"),
				},
				ApplicableProductNames: []string{
					"__Member__",
					"__Member__",
				},
				Description:     ptr.String("__Description__"),
				StartDate:       ptr.Time(time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)),
				EndDate:         ptr.Time(time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)),
				ExhaustDate:     ptr.Time(time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)),
				ApplicationType: types.ApplicationType("BEFORE_CROSS_SERVICE_DISCOUNTS"),
				ShareableAccounts: []string{
					"__Member__",
					"__Member__",
				},
				AccountHasCreditSharingEnabled: ptr.Bool(true),
				CreditConsoleVisibility:        ptr.String("__CreditConsoleVisibility__"),
				CreditSharingType:              types.CreditSharingType("DEFAULT"),
				CostCategoryArn:                ptr.String("__CostCategoryArn__"),
				RuleName:                       ptr.String("__RuleName__"),
				CreditStatus:                   types.CreditStatus("ENABLED"),
				PurchaseTypeApplications: []string{
					"__Member__",
					"__Member__",
				},
			},
			{
				CreditId:   ptr.String("__CreditId__"),
				AccountId:  ptr.String("__AccountId__"),
				CreditType: ptr.String("__CreditType__"),
				InitialAmount: &types.Amount{
					CurrencyCode:   ptr.String("__CurrencyCode__"),
					CurrencyAmount: ptr.String("__CurrencyAmount__"),
				},
				RemainingAmount: &types.Amount{
					CurrencyCode:   ptr.String("__CurrencyCode__"),
					CurrencyAmount: ptr.String("__CurrencyAmount__"),
				},
				EstimatedAmount: &types.Amount{
					CurrencyCode:   ptr.String("__CurrencyCode__"),
					CurrencyAmount: ptr.String("__CurrencyAmount__"),
				},
				ApplicableProductNames: []string{
					"__Member__",
					"__Member__",
				},
				Description:     ptr.String("__Description__"),
				StartDate:       ptr.Time(time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)),
				EndDate:         ptr.Time(time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)),
				ExhaustDate:     ptr.Time(time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)),
				ApplicationType: types.ApplicationType("BEFORE_CROSS_SERVICE_DISCOUNTS"),
				ShareableAccounts: []string{
					"__Member__",
					"__Member__",
				},
				AccountHasCreditSharingEnabled: ptr.Bool(true),
				CreditConsoleVisibility:        ptr.String("__CreditConsoleVisibility__"),
				CreditSharingType:              types.CreditSharingType("DEFAULT"),
				CostCategoryArn:                ptr.String("__CostCategoryArn__"),
				RuleName:                       ptr.String("__RuleName__"),
				CreditStatus:                   types.CreditStatus("ENABLED"),
				PurchaseTypeApplications: []string{
					"__Member__",
					"__Member__",
				},
			},
		},
	}
	status, header, body, err := serdeRespReadSnapshot("GetCredits.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.GetCredits(context.Background(), &GetCreditsInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "GetCredits.response", err)
	}
}

func TestCheckResponseSnapshot_GetResourcePolicy(t *testing.T) {
	want := &GetResourcePolicyOutput{
		ResourceArn: ptr.String("__ResourceArn__"),
		Policy:      ptr.String("__Policy__"),
	}
	status, header, body, err := serdeRespReadSnapshot("GetResourcePolicy.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.GetResourcePolicy(context.Background(), &GetResourcePolicyInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "GetResourcePolicy.response", err)
	}
}

func TestCheckResponseSnapshot_ListBillingViews(t *testing.T) {
	want := &ListBillingViewsOutput{
		BillingViews: []types.BillingViewListElement{
			{
				Arn:             ptr.String("__Arn__"),
				Name:            ptr.String("__Name__"),
				Description:     ptr.String("__Description__"),
				OwnerAccountId:  ptr.String("__OwnerAccountId__"),
				SourceAccountId: ptr.String("__SourceAccountId__"),
				BillingViewType: types.BillingViewType("PRIMARY"),
				HealthStatus: &types.BillingViewHealthStatus{
					StatusCode: types.BillingViewStatus("HEALTHY"),
					StatusReasons: []types.BillingViewStatusReason{
						types.BillingViewStatusReason("SOURCE_VIEW_UNHEALTHY"),
						types.BillingViewStatusReason("SOURCE_VIEW_UNHEALTHY"),
					},
				},
			},
			{
				Arn:             ptr.String("__Arn__"),
				Name:            ptr.String("__Name__"),
				Description:     ptr.String("__Description__"),
				OwnerAccountId:  ptr.String("__OwnerAccountId__"),
				SourceAccountId: ptr.String("__SourceAccountId__"),
				BillingViewType: types.BillingViewType("PRIMARY"),
				HealthStatus: &types.BillingViewHealthStatus{
					StatusCode: types.BillingViewStatus("HEALTHY"),
					StatusReasons: []types.BillingViewStatusReason{
						types.BillingViewStatusReason("SOURCE_VIEW_UNHEALTHY"),
						types.BillingViewStatusReason("SOURCE_VIEW_UNHEALTHY"),
					},
				},
			},
		},
		NextToken: ptr.String("__NextToken__"),
	}
	status, header, body, err := serdeRespReadSnapshot("ListBillingViews.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.ListBillingViews(context.Background(), &ListBillingViewsInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "ListBillingViews.response", err)
	}
}

func TestCheckResponseSnapshot_ListSourceViewsForBillingView(t *testing.T) {
	want := &ListSourceViewsForBillingViewOutput{
		SourceViews: []string{
			"__Member__",
			"__Member__",
		},
		NextToken: ptr.String("__NextToken__"),
	}
	status, header, body, err := serdeRespReadSnapshot("ListSourceViewsForBillingView.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.ListSourceViewsForBillingView(context.Background(), &ListSourceViewsForBillingViewInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "ListSourceViewsForBillingView.response", err)
	}
}

func TestCheckResponseSnapshot_ListTagsForResource(t *testing.T) {
	want := &ListTagsForResourceOutput{
		ResourceTags: []types.ResourceTag{
			{
				Key:   ptr.String("__Key__"),
				Value: ptr.String("__Value__"),
			},
			{
				Key:   ptr.String("__Key__"),
				Value: ptr.String("__Value__"),
			},
		},
	}
	status, header, body, err := serdeRespReadSnapshot("ListTagsForResource.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.ListTagsForResource(context.Background(), &ListTagsForResourceInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "ListTagsForResource.response", err)
	}
}

func TestCheckResponseSnapshot_RedeemCredits(t *testing.T) {
	want := &RedeemCreditsOutput{}
	status, header, body, err := serdeRespReadSnapshot("RedeemCredits.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.RedeemCredits(context.Background(), &RedeemCreditsInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "RedeemCredits.response", err)
	}
}

func TestCheckResponseSnapshot_TagResource(t *testing.T) {
	want := &TagResourceOutput{}
	status, header, body, err := serdeRespReadSnapshot("TagResource.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.TagResource(context.Background(), &TagResourceInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "TagResource.response", err)
	}
}

func TestCheckResponseSnapshot_UntagResource(t *testing.T) {
	want := &UntagResourceOutput{}
	status, header, body, err := serdeRespReadSnapshot("UntagResource.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.UntagResource(context.Background(), &UntagResourceInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "UntagResource.response", err)
	}
}

func TestCheckResponseSnapshot_UpdateBillingPreferences(t *testing.T) {
	want := &UpdateBillingPreferencesOutput{}
	status, header, body, err := serdeRespReadSnapshot("UpdateBillingPreferences.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.UpdateBillingPreferences(context.Background(), &UpdateBillingPreferencesInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "UpdateBillingPreferences.response", err)
	}
}

func TestCheckResponseSnapshot_UpdateBillingView(t *testing.T) {
	want := &UpdateBillingViewOutput{
		Arn:       ptr.String("__Arn__"),
		UpdatedAt: ptr.Time(time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)),
	}
	status, header, body, err := serdeRespReadSnapshot("UpdateBillingView.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.UpdateBillingView(context.Background(), &UpdateBillingViewInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "UpdateBillingView.response", err)
	}
}

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

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

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

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

func TestCheckResponseSnapshot_Error_ResourceNotFoundException(t *testing.T) {
	want := &types.ResourceNotFoundException{
		Message:      ptr.String("__Message__"),
		ResourceId:   ptr.String("__ResourceId__"),
		ResourceType: ptr.String("__ResourceType__"),
	}
	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.AssociateSourceViews(context.Background(), &AssociateSourceViewsInput{})
	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_ServiceQuotaExceededException(t *testing.T) {
	want := &types.ServiceQuotaExceededException{
		Message:      ptr.String("__Message__"),
		ResourceId:   ptr.String("__ResourceId__"),
		ResourceType: ptr.String("__ResourceType__"),
		ServiceCode:  ptr.String("__ServiceCode__"),
		QuotaCode:    ptr.String("__QuotaCode__"),
	}
	status, header, body, err := serdeRespReadSnapshot("ServiceQuotaExceededException.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.AssociateSourceViews(context.Background(), &AssociateSourceViewsInput{})
	if opErr == nil {
		t.Fatal("expected error, got nil")
	}
	var got *types.ServiceQuotaExceededException
	if !errors.As(opErr, &got) {
		t.Fatalf("expected types.ServiceQuotaExceededException, got %v", opErr)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("error response snapshot mismatch for %s: %v", "ServiceQuotaExceededException.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.AssociateSourceViews(context.Background(), &AssociateSourceViewsInput{})
	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_ValidationException(t *testing.T) {
	want := &types.ValidationException{
		Message: ptr.String("__Message__"),
		Reason:  types.ValidationExceptionReason("unknownOperation"),
		FieldList: []types.ValidationExceptionField{
			{
				Name:    ptr.String("__Name__"),
				Message: ptr.String("__Message__"),
			},
			{
				Name:    ptr.String("__Name__"),
				Message: ptr.String("__Message__"),
			},
		},
	}
	status, header, body, err := serdeRespReadSnapshot("ValidationException.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.AssociateSourceViews(context.Background(), &AssociateSourceViewsInput{})
	if opErr == nil {
		t.Fatal("expected error, got nil")
	}
	var got *types.ValidationException
	if !errors.As(opErr, &got) {
		t.Fatalf("expected types.ValidationException, got %v", opErr)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("error response snapshot mismatch for %s: %v", "ValidationException.error", err)
	}
}
