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

//go:build request_snapshot

package kms

import (
	"bytes"
	"context"
	"errors"
	"fmt"
	"github.com/aws/aws-sdk-go-v2/service/kms/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"
	"time"
)

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_CancelKeyDeletion(t *testing.T) {
	input := &CancelKeyDeletionInput{
		KeyId: ptr.String("__KeyId__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.CancelKeyDeletion(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(), "CancelKeyDeletion"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_ConnectCustomKeyStore(t *testing.T) {
	input := &ConnectCustomKeyStoreInput{
		CustomKeyStoreId: ptr.String("__CustomKeyStoreId__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.ConnectCustomKeyStore(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(), "ConnectCustomKeyStore"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_CreateAlias(t *testing.T) {
	input := &CreateAliasInput{
		AliasName:   ptr.String("__AliasName__"),
		TargetKeyId: ptr.String("__TargetKeyId__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.CreateAlias(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(), "CreateAlias"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_CreateCustomKeyStore(t *testing.T) {
	input := &CreateCustomKeyStoreInput{
		CustomKeyStoreName:              ptr.String("__CustomKeyStoreName__"),
		CloudHsmClusterId:               ptr.String("__CloudHsmClusterId__"),
		TrustAnchorCertificate:          ptr.String("__TrustAnchorCertificate__"),
		KeyStorePassword:                ptr.String("__KeyStorePassword__"),
		CustomKeyStoreType:              types.CustomKeyStoreType("AWS_CLOUDHSM"),
		XksProxyUriEndpoint:             ptr.String("__XksProxyUriEndpoint__"),
		XksProxyUriPath:                 ptr.String("__XksProxyUriPath__"),
		XksProxyVpcEndpointServiceName:  ptr.String("__XksProxyVpcEndpointServiceName__"),
		XksProxyVpcEndpointServiceOwner: ptr.String("__XksProxyVpcEndpointServiceOwner__"),
		XksProxyAuthenticationCredential: &types.XksProxyAuthenticationCredentialType{
			AccessKeyId:        ptr.String("__AccessKeyId__"),
			RawSecretAccessKey: ptr.String("__RawSecretAccessKey__"),
		},
		XksProxyConnectivity: types.XksProxyConnectivityType("PUBLIC_ENDPOINT"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.CreateCustomKeyStore(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(), "CreateCustomKeyStore"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_CreateGrant(t *testing.T) {
	input := &CreateGrantInput{
		KeyId:             ptr.String("__KeyId__"),
		GranteePrincipal:  ptr.String("__GranteePrincipal__"),
		RetiringPrincipal: ptr.String("__RetiringPrincipal__"),
		Operations: []types.GrantOperation{
			types.GrantOperation("Decrypt"),
			types.GrantOperation("Decrypt"),
		},
		Constraints: &types.GrantConstraints{
			EncryptionContextSubset: map[string]string{
				"key0": "__Value__",
			},
			EncryptionContextEquals: map[string]string{
				"key0": "__Value__",
			},
			SourceArn: ptr.String("__SourceArn__"),
		},
		GrantTokens: []string{
			"__Member__",
			"__Member__",
		},
		Name:                     ptr.String("__Name__"),
		DryRun:                   ptr.Bool(true),
		GranteeServicePrincipal:  ptr.String("__GranteeServicePrincipal__"),
		RetiringServicePrincipal: ptr.String("__RetiringServicePrincipal__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.CreateGrant(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(), "CreateGrant"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_CreateKey(t *testing.T) {
	input := &CreateKeyInput{
		Policy:                         ptr.String("__Policy__"),
		Description:                    ptr.String("__Description__"),
		KeyUsage:                       types.KeyUsageType("SIGN_VERIFY"),
		CustomerMasterKeySpec:          types.CustomerMasterKeySpec("RSA_2048"),
		KeySpec:                        types.KeySpec("RSA_2048"),
		Origin:                         types.OriginType("AWS_KMS"),
		CustomKeyStoreId:               ptr.String("__CustomKeyStoreId__"),
		BypassPolicyLockoutSafetyCheck: true,
		Tags: []types.Tag{
			{
				TagKey:   ptr.String("__TagKey__"),
				TagValue: ptr.String("__TagValue__"),
			},
			{
				TagKey:   ptr.String("__TagKey__"),
				TagValue: ptr.String("__TagValue__"),
			},
		},
		MultiRegion: ptr.Bool(true),
		XksKeyId:    ptr.String("__XksKeyId__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.CreateKey(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(), "CreateKey"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_Decrypt(t *testing.T) {
	input := &DecryptInput{
		CiphertextBlob: []byte("blob"),
		EncryptionContext: map[string]string{
			"key0": "__Value__",
		},
		GrantTokens: []string{
			"__Member__",
			"__Member__",
		},
		KeyId:               ptr.String("__KeyId__"),
		EncryptionAlgorithm: types.EncryptionAlgorithmSpec("SYMMETRIC_DEFAULT"),
		Recipient: &types.RecipientInfo{
			KeyEncryptionAlgorithm: types.KeyEncryptionMechanism("RSAES_OAEP_SHA_256"),
			AttestationDocument:    []byte("blob"),
		},
		DryRun: ptr.Bool(true),
		DryRunModifiers: []types.DryRunModifierType{
			types.DryRunModifierType("IGNORE_CIPHERTEXT"),
			types.DryRunModifierType("IGNORE_CIPHERTEXT"),
		},
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.Decrypt(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(), "Decrypt"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_DeleteAlias(t *testing.T) {
	input := &DeleteAliasInput{
		AliasName: ptr.String("__AliasName__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.DeleteAlias(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(), "DeleteAlias"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_DeleteCustomKeyStore(t *testing.T) {
	input := &DeleteCustomKeyStoreInput{
		CustomKeyStoreId: ptr.String("__CustomKeyStoreId__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.DeleteCustomKeyStore(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(), "DeleteCustomKeyStore"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_DeleteImportedKeyMaterial(t *testing.T) {
	input := &DeleteImportedKeyMaterialInput{
		KeyId:         ptr.String("__KeyId__"),
		KeyMaterialId: ptr.String("__KeyMaterialId__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.DeleteImportedKeyMaterial(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(), "DeleteImportedKeyMaterial"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_DeriveSharedSecret(t *testing.T) {
	input := &DeriveSharedSecretInput{
		KeyId:                 ptr.String("__KeyId__"),
		KeyAgreementAlgorithm: types.KeyAgreementAlgorithmSpec("ECDH"),
		PublicKey:             []byte("blob"),
		GrantTokens: []string{
			"__Member__",
			"__Member__",
		},
		DryRun: ptr.Bool(true),
		Recipient: &types.RecipientInfo{
			KeyEncryptionAlgorithm: types.KeyEncryptionMechanism("RSAES_OAEP_SHA_256"),
			AttestationDocument:    []byte("blob"),
		},
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.DeriveSharedSecret(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(), "DeriveSharedSecret"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_DescribeCustomKeyStores(t *testing.T) {
	input := &DescribeCustomKeyStoresInput{
		CustomKeyStoreId:   ptr.String("__CustomKeyStoreId__"),
		CustomKeyStoreName: ptr.String("__CustomKeyStoreName__"),
		Limit:              ptr.Int32(1),
		Marker:             ptr.String("__Marker__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.DescribeCustomKeyStores(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(), "DescribeCustomKeyStores"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_DescribeKey(t *testing.T) {
	input := &DescribeKeyInput{
		KeyId: ptr.String("__KeyId__"),
		GrantTokens: []string{
			"__Member__",
			"__Member__",
		},
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.DescribeKey(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(), "DescribeKey"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_DisableKey(t *testing.T) {
	input := &DisableKeyInput{
		KeyId: ptr.String("__KeyId__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.DisableKey(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(), "DisableKey"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_DisableKeyRotation(t *testing.T) {
	input := &DisableKeyRotationInput{
		KeyId: ptr.String("__KeyId__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.DisableKeyRotation(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(), "DisableKeyRotation"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_DisconnectCustomKeyStore(t *testing.T) {
	input := &DisconnectCustomKeyStoreInput{
		CustomKeyStoreId: ptr.String("__CustomKeyStoreId__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.DisconnectCustomKeyStore(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(), "DisconnectCustomKeyStore"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_EnableKey(t *testing.T) {
	input := &EnableKeyInput{
		KeyId: ptr.String("__KeyId__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.EnableKey(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(), "EnableKey"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_EnableKeyRotation(t *testing.T) {
	input := &EnableKeyRotationInput{
		KeyId:                ptr.String("__KeyId__"),
		RotationPeriodInDays: ptr.Int32(1),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.EnableKeyRotation(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(), "EnableKeyRotation"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_Encrypt(t *testing.T) {
	input := &EncryptInput{
		KeyId:     ptr.String("__KeyId__"),
		Plaintext: []byte("blob"),
		EncryptionContext: map[string]string{
			"key0": "__Value__",
		},
		GrantTokens: []string{
			"__Member__",
			"__Member__",
		},
		EncryptionAlgorithm: types.EncryptionAlgorithmSpec("SYMMETRIC_DEFAULT"),
		DryRun:              ptr.Bool(true),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.Encrypt(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(), "Encrypt"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_GenerateDataKey(t *testing.T) {
	input := &GenerateDataKeyInput{
		KeyId: ptr.String("__KeyId__"),
		EncryptionContext: map[string]string{
			"key0": "__Value__",
		},
		NumberOfBytes: ptr.Int32(1),
		KeySpec:       types.DataKeySpec("AES_256"),
		GrantTokens: []string{
			"__Member__",
			"__Member__",
		},
		Recipient: &types.RecipientInfo{
			KeyEncryptionAlgorithm: types.KeyEncryptionMechanism("RSAES_OAEP_SHA_256"),
			AttestationDocument:    []byte("blob"),
		},
		DryRun: ptr.Bool(true),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.GenerateDataKey(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(), "GenerateDataKey"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_GenerateDataKeyPair(t *testing.T) {
	input := &GenerateDataKeyPairInput{
		EncryptionContext: map[string]string{
			"key0": "__Value__",
		},
		KeyId:       ptr.String("__KeyId__"),
		KeyPairSpec: types.DataKeyPairSpec("RSA_2048"),
		GrantTokens: []string{
			"__Member__",
			"__Member__",
		},
		Recipient: &types.RecipientInfo{
			KeyEncryptionAlgorithm: types.KeyEncryptionMechanism("RSAES_OAEP_SHA_256"),
			AttestationDocument:    []byte("blob"),
		},
		DryRun: ptr.Bool(true),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.GenerateDataKeyPair(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(), "GenerateDataKeyPair"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_GenerateDataKeyPairWithoutPlaintext(t *testing.T) {
	input := &GenerateDataKeyPairWithoutPlaintextInput{
		EncryptionContext: map[string]string{
			"key0": "__Value__",
		},
		KeyId:       ptr.String("__KeyId__"),
		KeyPairSpec: types.DataKeyPairSpec("RSA_2048"),
		GrantTokens: []string{
			"__Member__",
			"__Member__",
		},
		DryRun: ptr.Bool(true),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.GenerateDataKeyPairWithoutPlaintext(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(), "GenerateDataKeyPairWithoutPlaintext"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_GenerateDataKeyWithoutPlaintext(t *testing.T) {
	input := &GenerateDataKeyWithoutPlaintextInput{
		KeyId: ptr.String("__KeyId__"),
		EncryptionContext: map[string]string{
			"key0": "__Value__",
		},
		KeySpec:       types.DataKeySpec("AES_256"),
		NumberOfBytes: ptr.Int32(1),
		GrantTokens: []string{
			"__Member__",
			"__Member__",
		},
		DryRun: ptr.Bool(true),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.GenerateDataKeyWithoutPlaintext(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(), "GenerateDataKeyWithoutPlaintext"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_GenerateMac(t *testing.T) {
	input := &GenerateMacInput{
		Message:      []byte("blob"),
		KeyId:        ptr.String("__KeyId__"),
		MacAlgorithm: types.MacAlgorithmSpec("HMAC_SHA_224"),
		GrantTokens: []string{
			"__Member__",
			"__Member__",
		},
		DryRun: ptr.Bool(true),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.GenerateMac(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(), "GenerateMac"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_GenerateRandom(t *testing.T) {
	input := &GenerateRandomInput{
		NumberOfBytes:    ptr.Int32(1),
		CustomKeyStoreId: ptr.String("__CustomKeyStoreId__"),
		Recipient: &types.RecipientInfo{
			KeyEncryptionAlgorithm: types.KeyEncryptionMechanism("RSAES_OAEP_SHA_256"),
			AttestationDocument:    []byte("blob"),
		},
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.GenerateRandom(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(), "GenerateRandom"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_GetKeyLastUsage(t *testing.T) {
	input := &GetKeyLastUsageInput{
		KeyId: ptr.String("__KeyId__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.GetKeyLastUsage(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(), "GetKeyLastUsage"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_GetKeyPolicy(t *testing.T) {
	input := &GetKeyPolicyInput{
		KeyId:      ptr.String("__KeyId__"),
		PolicyName: ptr.String("__PolicyName__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.GetKeyPolicy(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(), "GetKeyPolicy"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_GetKeyRotationStatus(t *testing.T) {
	input := &GetKeyRotationStatusInput{
		KeyId: ptr.String("__KeyId__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.GetKeyRotationStatus(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(), "GetKeyRotationStatus"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_GetParametersForImport(t *testing.T) {
	input := &GetParametersForImportInput{
		KeyId:             ptr.String("__KeyId__"),
		WrappingAlgorithm: types.AlgorithmSpec("RSAES_PKCS1_V1_5"),
		WrappingKeySpec:   types.WrappingKeySpec("RSA_2048"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.GetParametersForImport(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(), "GetParametersForImport"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_GetPublicKey(t *testing.T) {
	input := &GetPublicKeyInput{
		KeyId: ptr.String("__KeyId__"),
		GrantTokens: []string{
			"__Member__",
			"__Member__",
		},
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.GetPublicKey(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(), "GetPublicKey"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_ImportKeyMaterial(t *testing.T) {
	input := &ImportKeyMaterialInput{
		KeyId:                  ptr.String("__KeyId__"),
		ImportToken:            []byte("blob"),
		EncryptedKeyMaterial:   []byte("blob"),
		ValidTo:                ptr.Time(time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)),
		ExpirationModel:        types.ExpirationModelType("KEY_MATERIAL_EXPIRES"),
		ImportType:             types.ImportType("NEW_KEY_MATERIAL"),
		KeyMaterialDescription: ptr.String("__KeyMaterialDescription__"),
		KeyMaterialId:          ptr.String("__KeyMaterialId__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.ImportKeyMaterial(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(), "ImportKeyMaterial"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_ListAliases(t *testing.T) {
	input := &ListAliasesInput{
		KeyId:  ptr.String("__KeyId__"),
		Limit:  ptr.Int32(1),
		Marker: ptr.String("__Marker__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.ListAliases(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(), "ListAliases"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_ListGrants(t *testing.T) {
	input := &ListGrantsInput{
		Limit:                   ptr.Int32(1),
		Marker:                  ptr.String("__Marker__"),
		KeyId:                   ptr.String("__KeyId__"),
		GrantId:                 ptr.String("__GrantId__"),
		GranteePrincipal:        ptr.String("__GranteePrincipal__"),
		GranteeServicePrincipal: ptr.String("__GranteeServicePrincipal__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.ListGrants(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(), "ListGrants"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_ListKeyPolicies(t *testing.T) {
	input := &ListKeyPoliciesInput{
		KeyId:  ptr.String("__KeyId__"),
		Limit:  ptr.Int32(1),
		Marker: ptr.String("__Marker__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.ListKeyPolicies(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(), "ListKeyPolicies"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_ListKeyRotations(t *testing.T) {
	input := &ListKeyRotationsInput{
		KeyId:              ptr.String("__KeyId__"),
		IncludeKeyMaterial: types.IncludeKeyMaterial("ALL_KEY_MATERIAL"),
		Limit:              ptr.Int32(1),
		Marker:             ptr.String("__Marker__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.ListKeyRotations(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(), "ListKeyRotations"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_ListKeys(t *testing.T) {
	input := &ListKeysInput{
		Limit:  ptr.Int32(1),
		Marker: ptr.String("__Marker__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.ListKeys(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(), "ListKeys"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_ListResourceTags(t *testing.T) {
	input := &ListResourceTagsInput{
		KeyId:  ptr.String("__KeyId__"),
		Limit:  ptr.Int32(1),
		Marker: ptr.String("__Marker__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.ListResourceTags(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(), "ListResourceTags"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_ListRetirableGrants(t *testing.T) {
	input := &ListRetirableGrantsInput{
		Limit:                    ptr.Int32(1),
		Marker:                   ptr.String("__Marker__"),
		RetiringPrincipal:        ptr.String("__RetiringPrincipal__"),
		RetiringServicePrincipal: ptr.String("__RetiringServicePrincipal__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.ListRetirableGrants(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(), "ListRetirableGrants"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_PutKeyPolicy(t *testing.T) {
	input := &PutKeyPolicyInput{
		KeyId:                          ptr.String("__KeyId__"),
		PolicyName:                     ptr.String("__PolicyName__"),
		Policy:                         ptr.String("__Policy__"),
		BypassPolicyLockoutSafetyCheck: true,
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.PutKeyPolicy(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(), "PutKeyPolicy"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_ReEncrypt(t *testing.T) {
	input := &ReEncryptInput{
		CiphertextBlob: []byte("blob"),
		SourceEncryptionContext: map[string]string{
			"key0": "__Value__",
		},
		SourceKeyId:      ptr.String("__SourceKeyId__"),
		DestinationKeyId: ptr.String("__DestinationKeyId__"),
		DestinationEncryptionContext: map[string]string{
			"key0": "__Value__",
		},
		SourceEncryptionAlgorithm:      types.EncryptionAlgorithmSpec("SYMMETRIC_DEFAULT"),
		DestinationEncryptionAlgorithm: types.EncryptionAlgorithmSpec("SYMMETRIC_DEFAULT"),
		GrantTokens: []string{
			"__Member__",
			"__Member__",
		},
		DryRun: ptr.Bool(true),
		DryRunModifiers: []types.DryRunModifierType{
			types.DryRunModifierType("IGNORE_CIPHERTEXT"),
			types.DryRunModifierType("IGNORE_CIPHERTEXT"),
		},
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.ReEncrypt(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(), "ReEncrypt"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_ReplicateKey(t *testing.T) {
	input := &ReplicateKeyInput{
		KeyId:                          ptr.String("__KeyId__"),
		ReplicaRegion:                  ptr.String("__ReplicaRegion__"),
		Policy:                         ptr.String("__Policy__"),
		BypassPolicyLockoutSafetyCheck: true,
		Description:                    ptr.String("__Description__"),
		Tags: []types.Tag{
			{
				TagKey:   ptr.String("__TagKey__"),
				TagValue: ptr.String("__TagValue__"),
			},
			{
				TagKey:   ptr.String("__TagKey__"),
				TagValue: ptr.String("__TagValue__"),
			},
		},
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.ReplicateKey(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(), "ReplicateKey"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_RetireGrant(t *testing.T) {
	input := &RetireGrantInput{
		GrantToken: ptr.String("__GrantToken__"),
		KeyId:      ptr.String("__KeyId__"),
		GrantId:    ptr.String("__GrantId__"),
		DryRun:     ptr.Bool(true),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.RetireGrant(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(), "RetireGrant"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_RevokeGrant(t *testing.T) {
	input := &RevokeGrantInput{
		KeyId:   ptr.String("__KeyId__"),
		GrantId: ptr.String("__GrantId__"),
		DryRun:  ptr.Bool(true),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.RevokeGrant(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(), "RevokeGrant"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_RotateKeyOnDemand(t *testing.T) {
	input := &RotateKeyOnDemandInput{
		KeyId: ptr.String("__KeyId__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.RotateKeyOnDemand(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(), "RotateKeyOnDemand"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_ScheduleKeyDeletion(t *testing.T) {
	input := &ScheduleKeyDeletionInput{
		KeyId:               ptr.String("__KeyId__"),
		PendingWindowInDays: ptr.Int32(1),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.ScheduleKeyDeletion(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(), "ScheduleKeyDeletion"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_Sign(t *testing.T) {
	input := &SignInput{
		KeyId:       ptr.String("__KeyId__"),
		Message:     []byte("blob"),
		MessageType: types.MessageType("RAW"),
		GrantTokens: []string{
			"__Member__",
			"__Member__",
		},
		SigningAlgorithm: types.SigningAlgorithmSpec("RSASSA_PSS_SHA_256"),
		DryRun:           ptr.Bool(true),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.Sign(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(), "Sign"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_TagResource(t *testing.T) {
	input := &TagResourceInput{
		KeyId: ptr.String("__KeyId__"),
		Tags: []types.Tag{
			{
				TagKey:   ptr.String("__TagKey__"),
				TagValue: ptr.String("__TagValue__"),
			},
			{
				TagKey:   ptr.String("__TagKey__"),
				TagValue: ptr.String("__TagValue__"),
			},
		},
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.TagResource(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(), "TagResource"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_UntagResource(t *testing.T) {
	input := &UntagResourceInput{
		KeyId: ptr.String("__KeyId__"),
		TagKeys: []string{
			"__Member__",
			"__Member__",
		},
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.UntagResource(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(), "UntagResource"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_UpdateAlias(t *testing.T) {
	input := &UpdateAliasInput{
		AliasName:   ptr.String("__AliasName__"),
		TargetKeyId: ptr.String("__TargetKeyId__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.UpdateAlias(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(), "UpdateAlias"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_UpdateCustomKeyStore(t *testing.T) {
	input := &UpdateCustomKeyStoreInput{
		CustomKeyStoreId:                ptr.String("__CustomKeyStoreId__"),
		NewCustomKeyStoreName:           ptr.String("__NewCustomKeyStoreName__"),
		KeyStorePassword:                ptr.String("__KeyStorePassword__"),
		CloudHsmClusterId:               ptr.String("__CloudHsmClusterId__"),
		XksProxyUriEndpoint:             ptr.String("__XksProxyUriEndpoint__"),
		XksProxyUriPath:                 ptr.String("__XksProxyUriPath__"),
		XksProxyVpcEndpointServiceName:  ptr.String("__XksProxyVpcEndpointServiceName__"),
		XksProxyVpcEndpointServiceOwner: ptr.String("__XksProxyVpcEndpointServiceOwner__"),
		XksProxyAuthenticationCredential: &types.XksProxyAuthenticationCredentialType{
			AccessKeyId:        ptr.String("__AccessKeyId__"),
			RawSecretAccessKey: ptr.String("__RawSecretAccessKey__"),
		},
		XksProxyConnectivity: types.XksProxyConnectivityType("PUBLIC_ENDPOINT"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.UpdateCustomKeyStore(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(), "UpdateCustomKeyStore"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_UpdateKeyDescription(t *testing.T) {
	input := &UpdateKeyDescriptionInput{
		KeyId:       ptr.String("__KeyId__"),
		Description: ptr.String("__Description__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.UpdateKeyDescription(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(), "UpdateKeyDescription"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_UpdatePrimaryRegion(t *testing.T) {
	input := &UpdatePrimaryRegionInput{
		KeyId:         ptr.String("__KeyId__"),
		PrimaryRegion: ptr.String("__PrimaryRegion__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.UpdatePrimaryRegion(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(), "UpdatePrimaryRegion"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_Verify(t *testing.T) {
	input := &VerifyInput{
		KeyId:            ptr.String("__KeyId__"),
		Message:          []byte("blob"),
		MessageType:      types.MessageType("RAW"),
		Signature:        []byte("blob"),
		SigningAlgorithm: types.SigningAlgorithmSpec("RSASSA_PSS_SHA_256"),
		GrantTokens: []string{
			"__Member__",
			"__Member__",
		},
		DryRun: ptr.Bool(true),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.Verify(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(), "Verify"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_VerifyMac(t *testing.T) {
	input := &VerifyMacInput{
		Message:      []byte("blob"),
		KeyId:        ptr.String("__KeyId__"),
		MacAlgorithm: types.MacAlgorithmSpec("HMAC_SHA_224"),
		Mac:          []byte("blob"),
		GrantTokens: []string{
			"__Member__",
			"__Member__",
		},
		DryRun: ptr.Bool(true),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.VerifyMac(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(), "VerifyMac"); err != nil {
		t.Fatal(err)
	}
}
func TestUpdateRequestSnapshot_CancelKeyDeletion(t *testing.T) {
	input := &CancelKeyDeletionInput{
		KeyId: ptr.String("__KeyId__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.CancelKeyDeletion(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(), "CancelKeyDeletion"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_ConnectCustomKeyStore(t *testing.T) {
	input := &ConnectCustomKeyStoreInput{
		CustomKeyStoreId: ptr.String("__CustomKeyStoreId__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.ConnectCustomKeyStore(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(), "ConnectCustomKeyStore"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_CreateAlias(t *testing.T) {
	input := &CreateAliasInput{
		AliasName:   ptr.String("__AliasName__"),
		TargetKeyId: ptr.String("__TargetKeyId__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.CreateAlias(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(), "CreateAlias"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_CreateCustomKeyStore(t *testing.T) {
	input := &CreateCustomKeyStoreInput{
		CustomKeyStoreName:              ptr.String("__CustomKeyStoreName__"),
		CloudHsmClusterId:               ptr.String("__CloudHsmClusterId__"),
		TrustAnchorCertificate:          ptr.String("__TrustAnchorCertificate__"),
		KeyStorePassword:                ptr.String("__KeyStorePassword__"),
		CustomKeyStoreType:              types.CustomKeyStoreType("AWS_CLOUDHSM"),
		XksProxyUriEndpoint:             ptr.String("__XksProxyUriEndpoint__"),
		XksProxyUriPath:                 ptr.String("__XksProxyUriPath__"),
		XksProxyVpcEndpointServiceName:  ptr.String("__XksProxyVpcEndpointServiceName__"),
		XksProxyVpcEndpointServiceOwner: ptr.String("__XksProxyVpcEndpointServiceOwner__"),
		XksProxyAuthenticationCredential: &types.XksProxyAuthenticationCredentialType{
			AccessKeyId:        ptr.String("__AccessKeyId__"),
			RawSecretAccessKey: ptr.String("__RawSecretAccessKey__"),
		},
		XksProxyConnectivity: types.XksProxyConnectivityType("PUBLIC_ENDPOINT"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.CreateCustomKeyStore(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(), "CreateCustomKeyStore"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_CreateGrant(t *testing.T) {
	input := &CreateGrantInput{
		KeyId:             ptr.String("__KeyId__"),
		GranteePrincipal:  ptr.String("__GranteePrincipal__"),
		RetiringPrincipal: ptr.String("__RetiringPrincipal__"),
		Operations: []types.GrantOperation{
			types.GrantOperation("Decrypt"),
			types.GrantOperation("Decrypt"),
		},
		Constraints: &types.GrantConstraints{
			EncryptionContextSubset: map[string]string{
				"key0": "__Value__",
			},
			EncryptionContextEquals: map[string]string{
				"key0": "__Value__",
			},
			SourceArn: ptr.String("__SourceArn__"),
		},
		GrantTokens: []string{
			"__Member__",
			"__Member__",
		},
		Name:                     ptr.String("__Name__"),
		DryRun:                   ptr.Bool(true),
		GranteeServicePrincipal:  ptr.String("__GranteeServicePrincipal__"),
		RetiringServicePrincipal: ptr.String("__RetiringServicePrincipal__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.CreateGrant(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(), "CreateGrant"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_CreateKey(t *testing.T) {
	input := &CreateKeyInput{
		Policy:                         ptr.String("__Policy__"),
		Description:                    ptr.String("__Description__"),
		KeyUsage:                       types.KeyUsageType("SIGN_VERIFY"),
		CustomerMasterKeySpec:          types.CustomerMasterKeySpec("RSA_2048"),
		KeySpec:                        types.KeySpec("RSA_2048"),
		Origin:                         types.OriginType("AWS_KMS"),
		CustomKeyStoreId:               ptr.String("__CustomKeyStoreId__"),
		BypassPolicyLockoutSafetyCheck: true,
		Tags: []types.Tag{
			{
				TagKey:   ptr.String("__TagKey__"),
				TagValue: ptr.String("__TagValue__"),
			},
			{
				TagKey:   ptr.String("__TagKey__"),
				TagValue: ptr.String("__TagValue__"),
			},
		},
		MultiRegion: ptr.Bool(true),
		XksKeyId:    ptr.String("__XksKeyId__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.CreateKey(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(), "CreateKey"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_Decrypt(t *testing.T) {
	input := &DecryptInput{
		CiphertextBlob: []byte("blob"),
		EncryptionContext: map[string]string{
			"key0": "__Value__",
		},
		GrantTokens: []string{
			"__Member__",
			"__Member__",
		},
		KeyId:               ptr.String("__KeyId__"),
		EncryptionAlgorithm: types.EncryptionAlgorithmSpec("SYMMETRIC_DEFAULT"),
		Recipient: &types.RecipientInfo{
			KeyEncryptionAlgorithm: types.KeyEncryptionMechanism("RSAES_OAEP_SHA_256"),
			AttestationDocument:    []byte("blob"),
		},
		DryRun: ptr.Bool(true),
		DryRunModifiers: []types.DryRunModifierType{
			types.DryRunModifierType("IGNORE_CIPHERTEXT"),
			types.DryRunModifierType("IGNORE_CIPHERTEXT"),
		},
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.Decrypt(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(), "Decrypt"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_DeleteAlias(t *testing.T) {
	input := &DeleteAliasInput{
		AliasName: ptr.String("__AliasName__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.DeleteAlias(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(), "DeleteAlias"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_DeleteCustomKeyStore(t *testing.T) {
	input := &DeleteCustomKeyStoreInput{
		CustomKeyStoreId: ptr.String("__CustomKeyStoreId__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.DeleteCustomKeyStore(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(), "DeleteCustomKeyStore"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_DeleteImportedKeyMaterial(t *testing.T) {
	input := &DeleteImportedKeyMaterialInput{
		KeyId:         ptr.String("__KeyId__"),
		KeyMaterialId: ptr.String("__KeyMaterialId__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.DeleteImportedKeyMaterial(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(), "DeleteImportedKeyMaterial"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_DeriveSharedSecret(t *testing.T) {
	input := &DeriveSharedSecretInput{
		KeyId:                 ptr.String("__KeyId__"),
		KeyAgreementAlgorithm: types.KeyAgreementAlgorithmSpec("ECDH"),
		PublicKey:             []byte("blob"),
		GrantTokens: []string{
			"__Member__",
			"__Member__",
		},
		DryRun: ptr.Bool(true),
		Recipient: &types.RecipientInfo{
			KeyEncryptionAlgorithm: types.KeyEncryptionMechanism("RSAES_OAEP_SHA_256"),
			AttestationDocument:    []byte("blob"),
		},
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.DeriveSharedSecret(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(), "DeriveSharedSecret"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_DescribeCustomKeyStores(t *testing.T) {
	input := &DescribeCustomKeyStoresInput{
		CustomKeyStoreId:   ptr.String("__CustomKeyStoreId__"),
		CustomKeyStoreName: ptr.String("__CustomKeyStoreName__"),
		Limit:              ptr.Int32(1),
		Marker:             ptr.String("__Marker__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.DescribeCustomKeyStores(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(), "DescribeCustomKeyStores"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_DescribeKey(t *testing.T) {
	input := &DescribeKeyInput{
		KeyId: ptr.String("__KeyId__"),
		GrantTokens: []string{
			"__Member__",
			"__Member__",
		},
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.DescribeKey(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(), "DescribeKey"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_DisableKey(t *testing.T) {
	input := &DisableKeyInput{
		KeyId: ptr.String("__KeyId__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.DisableKey(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(), "DisableKey"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_DisableKeyRotation(t *testing.T) {
	input := &DisableKeyRotationInput{
		KeyId: ptr.String("__KeyId__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.DisableKeyRotation(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(), "DisableKeyRotation"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_DisconnectCustomKeyStore(t *testing.T) {
	input := &DisconnectCustomKeyStoreInput{
		CustomKeyStoreId: ptr.String("__CustomKeyStoreId__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.DisconnectCustomKeyStore(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(), "DisconnectCustomKeyStore"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_EnableKey(t *testing.T) {
	input := &EnableKeyInput{
		KeyId: ptr.String("__KeyId__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.EnableKey(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(), "EnableKey"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_EnableKeyRotation(t *testing.T) {
	input := &EnableKeyRotationInput{
		KeyId:                ptr.String("__KeyId__"),
		RotationPeriodInDays: ptr.Int32(1),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.EnableKeyRotation(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(), "EnableKeyRotation"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_Encrypt(t *testing.T) {
	input := &EncryptInput{
		KeyId:     ptr.String("__KeyId__"),
		Plaintext: []byte("blob"),
		EncryptionContext: map[string]string{
			"key0": "__Value__",
		},
		GrantTokens: []string{
			"__Member__",
			"__Member__",
		},
		EncryptionAlgorithm: types.EncryptionAlgorithmSpec("SYMMETRIC_DEFAULT"),
		DryRun:              ptr.Bool(true),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.Encrypt(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(), "Encrypt"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_GenerateDataKey(t *testing.T) {
	input := &GenerateDataKeyInput{
		KeyId: ptr.String("__KeyId__"),
		EncryptionContext: map[string]string{
			"key0": "__Value__",
		},
		NumberOfBytes: ptr.Int32(1),
		KeySpec:       types.DataKeySpec("AES_256"),
		GrantTokens: []string{
			"__Member__",
			"__Member__",
		},
		Recipient: &types.RecipientInfo{
			KeyEncryptionAlgorithm: types.KeyEncryptionMechanism("RSAES_OAEP_SHA_256"),
			AttestationDocument:    []byte("blob"),
		},
		DryRun: ptr.Bool(true),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.GenerateDataKey(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(), "GenerateDataKey"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_GenerateDataKeyPair(t *testing.T) {
	input := &GenerateDataKeyPairInput{
		EncryptionContext: map[string]string{
			"key0": "__Value__",
		},
		KeyId:       ptr.String("__KeyId__"),
		KeyPairSpec: types.DataKeyPairSpec("RSA_2048"),
		GrantTokens: []string{
			"__Member__",
			"__Member__",
		},
		Recipient: &types.RecipientInfo{
			KeyEncryptionAlgorithm: types.KeyEncryptionMechanism("RSAES_OAEP_SHA_256"),
			AttestationDocument:    []byte("blob"),
		},
		DryRun: ptr.Bool(true),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.GenerateDataKeyPair(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(), "GenerateDataKeyPair"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_GenerateDataKeyPairWithoutPlaintext(t *testing.T) {
	input := &GenerateDataKeyPairWithoutPlaintextInput{
		EncryptionContext: map[string]string{
			"key0": "__Value__",
		},
		KeyId:       ptr.String("__KeyId__"),
		KeyPairSpec: types.DataKeyPairSpec("RSA_2048"),
		GrantTokens: []string{
			"__Member__",
			"__Member__",
		},
		DryRun: ptr.Bool(true),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.GenerateDataKeyPairWithoutPlaintext(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(), "GenerateDataKeyPairWithoutPlaintext"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_GenerateDataKeyWithoutPlaintext(t *testing.T) {
	input := &GenerateDataKeyWithoutPlaintextInput{
		KeyId: ptr.String("__KeyId__"),
		EncryptionContext: map[string]string{
			"key0": "__Value__",
		},
		KeySpec:       types.DataKeySpec("AES_256"),
		NumberOfBytes: ptr.Int32(1),
		GrantTokens: []string{
			"__Member__",
			"__Member__",
		},
		DryRun: ptr.Bool(true),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.GenerateDataKeyWithoutPlaintext(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(), "GenerateDataKeyWithoutPlaintext"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_GenerateMac(t *testing.T) {
	input := &GenerateMacInput{
		Message:      []byte("blob"),
		KeyId:        ptr.String("__KeyId__"),
		MacAlgorithm: types.MacAlgorithmSpec("HMAC_SHA_224"),
		GrantTokens: []string{
			"__Member__",
			"__Member__",
		},
		DryRun: ptr.Bool(true),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.GenerateMac(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(), "GenerateMac"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_GenerateRandom(t *testing.T) {
	input := &GenerateRandomInput{
		NumberOfBytes:    ptr.Int32(1),
		CustomKeyStoreId: ptr.String("__CustomKeyStoreId__"),
		Recipient: &types.RecipientInfo{
			KeyEncryptionAlgorithm: types.KeyEncryptionMechanism("RSAES_OAEP_SHA_256"),
			AttestationDocument:    []byte("blob"),
		},
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.GenerateRandom(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(), "GenerateRandom"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_GetKeyLastUsage(t *testing.T) {
	input := &GetKeyLastUsageInput{
		KeyId: ptr.String("__KeyId__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.GetKeyLastUsage(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(), "GetKeyLastUsage"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_GetKeyPolicy(t *testing.T) {
	input := &GetKeyPolicyInput{
		KeyId:      ptr.String("__KeyId__"),
		PolicyName: ptr.String("__PolicyName__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.GetKeyPolicy(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(), "GetKeyPolicy"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_GetKeyRotationStatus(t *testing.T) {
	input := &GetKeyRotationStatusInput{
		KeyId: ptr.String("__KeyId__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.GetKeyRotationStatus(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(), "GetKeyRotationStatus"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_GetParametersForImport(t *testing.T) {
	input := &GetParametersForImportInput{
		KeyId:             ptr.String("__KeyId__"),
		WrappingAlgorithm: types.AlgorithmSpec("RSAES_PKCS1_V1_5"),
		WrappingKeySpec:   types.WrappingKeySpec("RSA_2048"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.GetParametersForImport(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(), "GetParametersForImport"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_GetPublicKey(t *testing.T) {
	input := &GetPublicKeyInput{
		KeyId: ptr.String("__KeyId__"),
		GrantTokens: []string{
			"__Member__",
			"__Member__",
		},
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.GetPublicKey(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(), "GetPublicKey"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_ImportKeyMaterial(t *testing.T) {
	input := &ImportKeyMaterialInput{
		KeyId:                  ptr.String("__KeyId__"),
		ImportToken:            []byte("blob"),
		EncryptedKeyMaterial:   []byte("blob"),
		ValidTo:                ptr.Time(time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)),
		ExpirationModel:        types.ExpirationModelType("KEY_MATERIAL_EXPIRES"),
		ImportType:             types.ImportType("NEW_KEY_MATERIAL"),
		KeyMaterialDescription: ptr.String("__KeyMaterialDescription__"),
		KeyMaterialId:          ptr.String("__KeyMaterialId__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.ImportKeyMaterial(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(), "ImportKeyMaterial"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_ListAliases(t *testing.T) {
	input := &ListAliasesInput{
		KeyId:  ptr.String("__KeyId__"),
		Limit:  ptr.Int32(1),
		Marker: ptr.String("__Marker__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.ListAliases(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(), "ListAliases"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_ListGrants(t *testing.T) {
	input := &ListGrantsInput{
		Limit:                   ptr.Int32(1),
		Marker:                  ptr.String("__Marker__"),
		KeyId:                   ptr.String("__KeyId__"),
		GrantId:                 ptr.String("__GrantId__"),
		GranteePrincipal:        ptr.String("__GranteePrincipal__"),
		GranteeServicePrincipal: ptr.String("__GranteeServicePrincipal__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.ListGrants(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(), "ListGrants"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_ListKeyPolicies(t *testing.T) {
	input := &ListKeyPoliciesInput{
		KeyId:  ptr.String("__KeyId__"),
		Limit:  ptr.Int32(1),
		Marker: ptr.String("__Marker__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.ListKeyPolicies(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(), "ListKeyPolicies"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_ListKeyRotations(t *testing.T) {
	input := &ListKeyRotationsInput{
		KeyId:              ptr.String("__KeyId__"),
		IncludeKeyMaterial: types.IncludeKeyMaterial("ALL_KEY_MATERIAL"),
		Limit:              ptr.Int32(1),
		Marker:             ptr.String("__Marker__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.ListKeyRotations(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(), "ListKeyRotations"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_ListKeys(t *testing.T) {
	input := &ListKeysInput{
		Limit:  ptr.Int32(1),
		Marker: ptr.String("__Marker__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.ListKeys(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(), "ListKeys"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_ListResourceTags(t *testing.T) {
	input := &ListResourceTagsInput{
		KeyId:  ptr.String("__KeyId__"),
		Limit:  ptr.Int32(1),
		Marker: ptr.String("__Marker__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.ListResourceTags(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(), "ListResourceTags"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_ListRetirableGrants(t *testing.T) {
	input := &ListRetirableGrantsInput{
		Limit:                    ptr.Int32(1),
		Marker:                   ptr.String("__Marker__"),
		RetiringPrincipal:        ptr.String("__RetiringPrincipal__"),
		RetiringServicePrincipal: ptr.String("__RetiringServicePrincipal__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.ListRetirableGrants(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(), "ListRetirableGrants"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_PutKeyPolicy(t *testing.T) {
	input := &PutKeyPolicyInput{
		KeyId:                          ptr.String("__KeyId__"),
		PolicyName:                     ptr.String("__PolicyName__"),
		Policy:                         ptr.String("__Policy__"),
		BypassPolicyLockoutSafetyCheck: true,
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.PutKeyPolicy(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(), "PutKeyPolicy"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_ReEncrypt(t *testing.T) {
	input := &ReEncryptInput{
		CiphertextBlob: []byte("blob"),
		SourceEncryptionContext: map[string]string{
			"key0": "__Value__",
		},
		SourceKeyId:      ptr.String("__SourceKeyId__"),
		DestinationKeyId: ptr.String("__DestinationKeyId__"),
		DestinationEncryptionContext: map[string]string{
			"key0": "__Value__",
		},
		SourceEncryptionAlgorithm:      types.EncryptionAlgorithmSpec("SYMMETRIC_DEFAULT"),
		DestinationEncryptionAlgorithm: types.EncryptionAlgorithmSpec("SYMMETRIC_DEFAULT"),
		GrantTokens: []string{
			"__Member__",
			"__Member__",
		},
		DryRun: ptr.Bool(true),
		DryRunModifiers: []types.DryRunModifierType{
			types.DryRunModifierType("IGNORE_CIPHERTEXT"),
			types.DryRunModifierType("IGNORE_CIPHERTEXT"),
		},
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.ReEncrypt(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(), "ReEncrypt"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_ReplicateKey(t *testing.T) {
	input := &ReplicateKeyInput{
		KeyId:                          ptr.String("__KeyId__"),
		ReplicaRegion:                  ptr.String("__ReplicaRegion__"),
		Policy:                         ptr.String("__Policy__"),
		BypassPolicyLockoutSafetyCheck: true,
		Description:                    ptr.String("__Description__"),
		Tags: []types.Tag{
			{
				TagKey:   ptr.String("__TagKey__"),
				TagValue: ptr.String("__TagValue__"),
			},
			{
				TagKey:   ptr.String("__TagKey__"),
				TagValue: ptr.String("__TagValue__"),
			},
		},
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.ReplicateKey(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(), "ReplicateKey"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_RetireGrant(t *testing.T) {
	input := &RetireGrantInput{
		GrantToken: ptr.String("__GrantToken__"),
		KeyId:      ptr.String("__KeyId__"),
		GrantId:    ptr.String("__GrantId__"),
		DryRun:     ptr.Bool(true),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.RetireGrant(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(), "RetireGrant"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_RevokeGrant(t *testing.T) {
	input := &RevokeGrantInput{
		KeyId:   ptr.String("__KeyId__"),
		GrantId: ptr.String("__GrantId__"),
		DryRun:  ptr.Bool(true),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.RevokeGrant(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(), "RevokeGrant"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_RotateKeyOnDemand(t *testing.T) {
	input := &RotateKeyOnDemandInput{
		KeyId: ptr.String("__KeyId__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.RotateKeyOnDemand(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(), "RotateKeyOnDemand"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_ScheduleKeyDeletion(t *testing.T) {
	input := &ScheduleKeyDeletionInput{
		KeyId:               ptr.String("__KeyId__"),
		PendingWindowInDays: ptr.Int32(1),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.ScheduleKeyDeletion(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(), "ScheduleKeyDeletion"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_Sign(t *testing.T) {
	input := &SignInput{
		KeyId:       ptr.String("__KeyId__"),
		Message:     []byte("blob"),
		MessageType: types.MessageType("RAW"),
		GrantTokens: []string{
			"__Member__",
			"__Member__",
		},
		SigningAlgorithm: types.SigningAlgorithmSpec("RSASSA_PSS_SHA_256"),
		DryRun:           ptr.Bool(true),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.Sign(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(), "Sign"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_TagResource(t *testing.T) {
	input := &TagResourceInput{
		KeyId: ptr.String("__KeyId__"),
		Tags: []types.Tag{
			{
				TagKey:   ptr.String("__TagKey__"),
				TagValue: ptr.String("__TagValue__"),
			},
			{
				TagKey:   ptr.String("__TagKey__"),
				TagValue: ptr.String("__TagValue__"),
			},
		},
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.TagResource(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(), "TagResource"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_UntagResource(t *testing.T) {
	input := &UntagResourceInput{
		KeyId: ptr.String("__KeyId__"),
		TagKeys: []string{
			"__Member__",
			"__Member__",
		},
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.UntagResource(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(), "UntagResource"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_UpdateAlias(t *testing.T) {
	input := &UpdateAliasInput{
		AliasName:   ptr.String("__AliasName__"),
		TargetKeyId: ptr.String("__TargetKeyId__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.UpdateAlias(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(), "UpdateAlias"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_UpdateCustomKeyStore(t *testing.T) {
	input := &UpdateCustomKeyStoreInput{
		CustomKeyStoreId:                ptr.String("__CustomKeyStoreId__"),
		NewCustomKeyStoreName:           ptr.String("__NewCustomKeyStoreName__"),
		KeyStorePassword:                ptr.String("__KeyStorePassword__"),
		CloudHsmClusterId:               ptr.String("__CloudHsmClusterId__"),
		XksProxyUriEndpoint:             ptr.String("__XksProxyUriEndpoint__"),
		XksProxyUriPath:                 ptr.String("__XksProxyUriPath__"),
		XksProxyVpcEndpointServiceName:  ptr.String("__XksProxyVpcEndpointServiceName__"),
		XksProxyVpcEndpointServiceOwner: ptr.String("__XksProxyVpcEndpointServiceOwner__"),
		XksProxyAuthenticationCredential: &types.XksProxyAuthenticationCredentialType{
			AccessKeyId:        ptr.String("__AccessKeyId__"),
			RawSecretAccessKey: ptr.String("__RawSecretAccessKey__"),
		},
		XksProxyConnectivity: types.XksProxyConnectivityType("PUBLIC_ENDPOINT"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.UpdateCustomKeyStore(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(), "UpdateCustomKeyStore"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_UpdateKeyDescription(t *testing.T) {
	input := &UpdateKeyDescriptionInput{
		KeyId:       ptr.String("__KeyId__"),
		Description: ptr.String("__Description__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.UpdateKeyDescription(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(), "UpdateKeyDescription"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_UpdatePrimaryRegion(t *testing.T) {
	input := &UpdatePrimaryRegionInput{
		KeyId:         ptr.String("__KeyId__"),
		PrimaryRegion: ptr.String("__PrimaryRegion__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.UpdatePrimaryRegion(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(), "UpdatePrimaryRegion"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_Verify(t *testing.T) {
	input := &VerifyInput{
		KeyId:            ptr.String("__KeyId__"),
		Message:          []byte("blob"),
		MessageType:      types.MessageType("RAW"),
		Signature:        []byte("blob"),
		SigningAlgorithm: types.SigningAlgorithmSpec("RSASSA_PSS_SHA_256"),
		GrantTokens: []string{
			"__Member__",
			"__Member__",
		},
		DryRun: ptr.Bool(true),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.Verify(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(), "Verify"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_VerifyMac(t *testing.T) {
	input := &VerifyMacInput{
		Message:      []byte("blob"),
		KeyId:        ptr.String("__KeyId__"),
		MacAlgorithm: types.MacAlgorithmSpec("HMAC_SHA_224"),
		Mac:          []byte("blob"),
		GrantTokens: []string{
			"__Member__",
			"__Member__",
		},
		DryRun: ptr.Bool(true),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.VerifyMac(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(), "VerifyMac"); err != nil {
		t.Fatal(err)
	}
}
