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

//go:build request_snapshot

package cloudsearch

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

const serdeSSPrefix = "request_snapshot"

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

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

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

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

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

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

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

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

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

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

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

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

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

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

type serdeEndpointResolver struct{}

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

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

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

func TestCheckRequestSnapshot_DefineAnalysisScheme(t *testing.T) {
	input := &DefineAnalysisSchemeInput{
		DomainName: ptr.String("__DomainName__"),
		AnalysisScheme: &types.AnalysisScheme{
			AnalysisSchemeName:     ptr.String("__AnalysisSchemeName__"),
			AnalysisSchemeLanguage: types.AnalysisSchemeLanguage("ar"),
			AnalysisOptions: &types.AnalysisOptions{
				Synonyms:                       ptr.String("__Synonyms__"),
				Stopwords:                      ptr.String("__Stopwords__"),
				StemmingDictionary:             ptr.String("__StemmingDictionary__"),
				JapaneseTokenizationDictionary: ptr.String("__JapaneseTokenizationDictionary__"),
				AlgorithmicStemming:            types.AlgorithmicStemming("none"),
			},
		},
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.DefineAnalysisScheme(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeTestSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "DefineAnalysisScheme"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_DefineExpression(t *testing.T) {
	input := &DefineExpressionInput{
		DomainName: ptr.String("__DomainName__"),
		Expression: &types.Expression{
			ExpressionName:  ptr.String("__ExpressionName__"),
			ExpressionValue: ptr.String("__ExpressionValue__"),
		},
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.DefineExpression(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeTestSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "DefineExpression"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_DefineIndexField(t *testing.T) {
	input := &DefineIndexFieldInput{
		DomainName: ptr.String("__DomainName__"),
		IndexField: &types.IndexField{
			IndexFieldName: ptr.String("__IndexFieldName__"),
			IndexFieldType: types.IndexFieldType("int"),
			IntOptions: &types.IntOptions{
				DefaultValue:  ptr.Int64(1),
				SourceField:   ptr.String("__SourceField__"),
				FacetEnabled:  ptr.Bool(true),
				SearchEnabled: ptr.Bool(true),
				ReturnEnabled: ptr.Bool(true),
				SortEnabled:   ptr.Bool(true),
			},
			DoubleOptions: &types.DoubleOptions{
				DefaultValue:  ptr.Float64(1.0),
				SourceField:   ptr.String("__SourceField__"),
				FacetEnabled:  ptr.Bool(true),
				SearchEnabled: ptr.Bool(true),
				ReturnEnabled: ptr.Bool(true),
				SortEnabled:   ptr.Bool(true),
			},
			LiteralOptions: &types.LiteralOptions{
				DefaultValue:  ptr.String("__DefaultValue__"),
				SourceField:   ptr.String("__SourceField__"),
				FacetEnabled:  ptr.Bool(true),
				SearchEnabled: ptr.Bool(true),
				ReturnEnabled: ptr.Bool(true),
				SortEnabled:   ptr.Bool(true),
			},
			TextOptions: &types.TextOptions{
				DefaultValue:     ptr.String("__DefaultValue__"),
				SourceField:      ptr.String("__SourceField__"),
				ReturnEnabled:    ptr.Bool(true),
				SortEnabled:      ptr.Bool(true),
				HighlightEnabled: ptr.Bool(true),
				AnalysisScheme:   ptr.String("__AnalysisScheme__"),
			},
			DateOptions: &types.DateOptions{
				DefaultValue:  ptr.String("__DefaultValue__"),
				SourceField:   ptr.String("__SourceField__"),
				FacetEnabled:  ptr.Bool(true),
				SearchEnabled: ptr.Bool(true),
				ReturnEnabled: ptr.Bool(true),
				SortEnabled:   ptr.Bool(true),
			},
			LatLonOptions: &types.LatLonOptions{
				DefaultValue:  ptr.String("__DefaultValue__"),
				SourceField:   ptr.String("__SourceField__"),
				FacetEnabled:  ptr.Bool(true),
				SearchEnabled: ptr.Bool(true),
				ReturnEnabled: ptr.Bool(true),
				SortEnabled:   ptr.Bool(true),
			},
			IntArrayOptions: &types.IntArrayOptions{
				DefaultValue:  ptr.Int64(1),
				SourceFields:  ptr.String("__SourceFields__"),
				FacetEnabled:  ptr.Bool(true),
				SearchEnabled: ptr.Bool(true),
				ReturnEnabled: ptr.Bool(true),
			},
			DoubleArrayOptions: &types.DoubleArrayOptions{
				DefaultValue:  ptr.Float64(1.0),
				SourceFields:  ptr.String("__SourceFields__"),
				FacetEnabled:  ptr.Bool(true),
				SearchEnabled: ptr.Bool(true),
				ReturnEnabled: ptr.Bool(true),
			},
			LiteralArrayOptions: &types.LiteralArrayOptions{
				DefaultValue:  ptr.String("__DefaultValue__"),
				SourceFields:  ptr.String("__SourceFields__"),
				FacetEnabled:  ptr.Bool(true),
				SearchEnabled: ptr.Bool(true),
				ReturnEnabled: ptr.Bool(true),
			},
			TextArrayOptions: &types.TextArrayOptions{
				DefaultValue:     ptr.String("__DefaultValue__"),
				SourceFields:     ptr.String("__SourceFields__"),
				ReturnEnabled:    ptr.Bool(true),
				HighlightEnabled: ptr.Bool(true),
				AnalysisScheme:   ptr.String("__AnalysisScheme__"),
			},
			DateArrayOptions: &types.DateArrayOptions{
				DefaultValue:  ptr.String("__DefaultValue__"),
				SourceFields:  ptr.String("__SourceFields__"),
				FacetEnabled:  ptr.Bool(true),
				SearchEnabled: ptr.Bool(true),
				ReturnEnabled: ptr.Bool(true),
			},
		},
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.DefineIndexField(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeTestSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "DefineIndexField"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_DefineSuggester(t *testing.T) {
	input := &DefineSuggesterInput{
		DomainName: ptr.String("__DomainName__"),
		Suggester: &types.Suggester{
			SuggesterName: ptr.String("__SuggesterName__"),
			DocumentSuggesterOptions: &types.DocumentSuggesterOptions{
				SourceField:    ptr.String("__SourceField__"),
				FuzzyMatching:  types.SuggesterFuzzyMatching("none"),
				SortExpression: ptr.String("__SortExpression__"),
			},
		},
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.DefineSuggester(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeTestSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "DefineSuggester"); err != nil {
		t.Fatal(err)
	}
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

func TestCheckRequestSnapshot_UpdateDomainEndpointOptions(t *testing.T) {
	input := &UpdateDomainEndpointOptionsInput{
		DomainName: ptr.String("__DomainName__"),
		DomainEndpointOptions: &types.DomainEndpointOptions{
			EnforceHTTPS:      ptr.Bool(true),
			TLSSecurityPolicy: types.TLSSecurityPolicy("Policy-Min-TLS-1-0-2019-07"),
		},
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.UpdateDomainEndpointOptions(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeTestSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "UpdateDomainEndpointOptions"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_UpdateScalingParameters(t *testing.T) {
	input := &UpdateScalingParametersInput{
		DomainName: ptr.String("__DomainName__"),
		ScalingParameters: &types.ScalingParameters{
			DesiredInstanceType:     types.PartitionInstanceType("search.m1.small"),
			DesiredReplicationCount: 1,
			DesiredPartitionCount:   1,
		},
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.UpdateScalingParameters(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeTestSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "UpdateScalingParameters"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_UpdateServiceAccessPolicies(t *testing.T) {
	input := &UpdateServiceAccessPoliciesInput{
		DomainName:     ptr.String("__DomainName__"),
		AccessPolicies: ptr.String("__AccessPolicies__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.UpdateServiceAccessPolicies(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeTestSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "UpdateServiceAccessPolicies"); err != nil {
		t.Fatal(err)
	}
}
func TestUpdateRequestSnapshot_BuildSuggesters(t *testing.T) {
	input := &BuildSuggestersInput{
		DomainName: ptr.String("__DomainName__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.BuildSuggesters(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeUpdateSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "BuildSuggesters"); err != nil {
		t.Fatal(err)
	}
}

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

func TestUpdateRequestSnapshot_DefineAnalysisScheme(t *testing.T) {
	input := &DefineAnalysisSchemeInput{
		DomainName: ptr.String("__DomainName__"),
		AnalysisScheme: &types.AnalysisScheme{
			AnalysisSchemeName:     ptr.String("__AnalysisSchemeName__"),
			AnalysisSchemeLanguage: types.AnalysisSchemeLanguage("ar"),
			AnalysisOptions: &types.AnalysisOptions{
				Synonyms:                       ptr.String("__Synonyms__"),
				Stopwords:                      ptr.String("__Stopwords__"),
				StemmingDictionary:             ptr.String("__StemmingDictionary__"),
				JapaneseTokenizationDictionary: ptr.String("__JapaneseTokenizationDictionary__"),
				AlgorithmicStemming:            types.AlgorithmicStemming("none"),
			},
		},
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.DefineAnalysisScheme(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeUpdateSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "DefineAnalysisScheme"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_DefineExpression(t *testing.T) {
	input := &DefineExpressionInput{
		DomainName: ptr.String("__DomainName__"),
		Expression: &types.Expression{
			ExpressionName:  ptr.String("__ExpressionName__"),
			ExpressionValue: ptr.String("__ExpressionValue__"),
		},
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.DefineExpression(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeUpdateSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "DefineExpression"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_DefineIndexField(t *testing.T) {
	input := &DefineIndexFieldInput{
		DomainName: ptr.String("__DomainName__"),
		IndexField: &types.IndexField{
			IndexFieldName: ptr.String("__IndexFieldName__"),
			IndexFieldType: types.IndexFieldType("int"),
			IntOptions: &types.IntOptions{
				DefaultValue:  ptr.Int64(1),
				SourceField:   ptr.String("__SourceField__"),
				FacetEnabled:  ptr.Bool(true),
				SearchEnabled: ptr.Bool(true),
				ReturnEnabled: ptr.Bool(true),
				SortEnabled:   ptr.Bool(true),
			},
			DoubleOptions: &types.DoubleOptions{
				DefaultValue:  ptr.Float64(1.0),
				SourceField:   ptr.String("__SourceField__"),
				FacetEnabled:  ptr.Bool(true),
				SearchEnabled: ptr.Bool(true),
				ReturnEnabled: ptr.Bool(true),
				SortEnabled:   ptr.Bool(true),
			},
			LiteralOptions: &types.LiteralOptions{
				DefaultValue:  ptr.String("__DefaultValue__"),
				SourceField:   ptr.String("__SourceField__"),
				FacetEnabled:  ptr.Bool(true),
				SearchEnabled: ptr.Bool(true),
				ReturnEnabled: ptr.Bool(true),
				SortEnabled:   ptr.Bool(true),
			},
			TextOptions: &types.TextOptions{
				DefaultValue:     ptr.String("__DefaultValue__"),
				SourceField:      ptr.String("__SourceField__"),
				ReturnEnabled:    ptr.Bool(true),
				SortEnabled:      ptr.Bool(true),
				HighlightEnabled: ptr.Bool(true),
				AnalysisScheme:   ptr.String("__AnalysisScheme__"),
			},
			DateOptions: &types.DateOptions{
				DefaultValue:  ptr.String("__DefaultValue__"),
				SourceField:   ptr.String("__SourceField__"),
				FacetEnabled:  ptr.Bool(true),
				SearchEnabled: ptr.Bool(true),
				ReturnEnabled: ptr.Bool(true),
				SortEnabled:   ptr.Bool(true),
			},
			LatLonOptions: &types.LatLonOptions{
				DefaultValue:  ptr.String("__DefaultValue__"),
				SourceField:   ptr.String("__SourceField__"),
				FacetEnabled:  ptr.Bool(true),
				SearchEnabled: ptr.Bool(true),
				ReturnEnabled: ptr.Bool(true),
				SortEnabled:   ptr.Bool(true),
			},
			IntArrayOptions: &types.IntArrayOptions{
				DefaultValue:  ptr.Int64(1),
				SourceFields:  ptr.String("__SourceFields__"),
				FacetEnabled:  ptr.Bool(true),
				SearchEnabled: ptr.Bool(true),
				ReturnEnabled: ptr.Bool(true),
			},
			DoubleArrayOptions: &types.DoubleArrayOptions{
				DefaultValue:  ptr.Float64(1.0),
				SourceFields:  ptr.String("__SourceFields__"),
				FacetEnabled:  ptr.Bool(true),
				SearchEnabled: ptr.Bool(true),
				ReturnEnabled: ptr.Bool(true),
			},
			LiteralArrayOptions: &types.LiteralArrayOptions{
				DefaultValue:  ptr.String("__DefaultValue__"),
				SourceFields:  ptr.String("__SourceFields__"),
				FacetEnabled:  ptr.Bool(true),
				SearchEnabled: ptr.Bool(true),
				ReturnEnabled: ptr.Bool(true),
			},
			TextArrayOptions: &types.TextArrayOptions{
				DefaultValue:     ptr.String("__DefaultValue__"),
				SourceFields:     ptr.String("__SourceFields__"),
				ReturnEnabled:    ptr.Bool(true),
				HighlightEnabled: ptr.Bool(true),
				AnalysisScheme:   ptr.String("__AnalysisScheme__"),
			},
			DateArrayOptions: &types.DateArrayOptions{
				DefaultValue:  ptr.String("__DefaultValue__"),
				SourceFields:  ptr.String("__SourceFields__"),
				FacetEnabled:  ptr.Bool(true),
				SearchEnabled: ptr.Bool(true),
				ReturnEnabled: ptr.Bool(true),
			},
		},
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.DefineIndexField(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeUpdateSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "DefineIndexField"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_DefineSuggester(t *testing.T) {
	input := &DefineSuggesterInput{
		DomainName: ptr.String("__DomainName__"),
		Suggester: &types.Suggester{
			SuggesterName: ptr.String("__SuggesterName__"),
			DocumentSuggesterOptions: &types.DocumentSuggesterOptions{
				SourceField:    ptr.String("__SourceField__"),
				FuzzyMatching:  types.SuggesterFuzzyMatching("none"),
				SortExpression: ptr.String("__SortExpression__"),
			},
		},
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.DefineSuggester(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeUpdateSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "DefineSuggester"); err != nil {
		t.Fatal(err)
	}
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

func TestUpdateRequestSnapshot_UpdateDomainEndpointOptions(t *testing.T) {
	input := &UpdateDomainEndpointOptionsInput{
		DomainName: ptr.String("__DomainName__"),
		DomainEndpointOptions: &types.DomainEndpointOptions{
			EnforceHTTPS:      ptr.Bool(true),
			TLSSecurityPolicy: types.TLSSecurityPolicy("Policy-Min-TLS-1-0-2019-07"),
		},
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.UpdateDomainEndpointOptions(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeUpdateSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "UpdateDomainEndpointOptions"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_UpdateScalingParameters(t *testing.T) {
	input := &UpdateScalingParametersInput{
		DomainName: ptr.String("__DomainName__"),
		ScalingParameters: &types.ScalingParameters{
			DesiredInstanceType:     types.PartitionInstanceType("search.m1.small"),
			DesiredReplicationCount: 1,
			DesiredPartitionCount:   1,
		},
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.UpdateScalingParameters(context.Background(), input, func(o *Options) {
		o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
			stack.Initialize.Remove("OperationInputValidation")
			stack.Serialize.Remove("RequestCompression")
			return stack.Finalize.Add(&captureSerdeRequestMiddleware{
				body: body, method: &method, rawPath: &rawPath, rawQuery: &rawQuery, header: &header,
			}, middleware.Before)
		})
	})
	if err != nil && !errors.Is(err, errSerdeSnapshotOK) {
		t.Fatal(err)
	}
	if err := serdeUpdateSnapshot(method, rawPath, rawQuery, header, body.Bytes(), "UpdateScalingParameters"); err != nil {
		t.Fatal(err)
	}
}

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