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

//go:build request_snapshot

package amplifybackend

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

const serdeSSPrefix = "request_snapshot"

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

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

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

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

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

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

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

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

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

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

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

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

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

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

type serdeEndpointResolver struct{}

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

func serdeNewClient() *Client {
	return New(Options{
		Region:             "us-east-1",
		EndpointResolverV2: &serdeEndpointResolver{},
	})
}
func serdeBodyEqual(got, expected []byte) bool {
	return bytes.Equal(got, expected)
}
func TestCheckRequestSnapshot_CloneBackend(t *testing.T) {
	input := &CloneBackendInput{
		AppId:                  ptr.String("__AppId__"),
		BackendEnvironmentName: ptr.String("__BackendEnvironmentName__"),
		TargetEnvironmentName:  ptr.String("__TargetEnvironmentName__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.CloneBackend(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(), "CloneBackend"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_CreateBackend(t *testing.T) {
	input := &CreateBackendInput{
		AppId:                  ptr.String("__AppId__"),
		AppName:                ptr.String("__AppName__"),
		BackendEnvironmentName: ptr.String("__BackendEnvironmentName__"),
		ResourceConfig:         &types.ResourceConfig{},
		ResourceName:           ptr.String("__ResourceName__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.CreateBackend(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(), "CreateBackend"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_CreateBackendAPI(t *testing.T) {
	input := &CreateBackendAPIInput{
		AppId:                  ptr.String("__AppId__"),
		BackendEnvironmentName: ptr.String("__BackendEnvironmentName__"),
		ResourceConfig: &types.BackendAPIResourceConfig{
			AdditionalAuthTypes: []types.BackendAPIAuthType{
				{
					Mode: types.Mode("API_KEY"),
					Settings: &types.BackendAPIAppSyncAuthSettings{
						CognitoUserPoolId:  ptr.String("__CognitoUserPoolId__"),
						Description:        ptr.String("__Description__"),
						ExpirationTime:     ptr.Float64(1.0),
						OpenIDAuthTTL:      ptr.String("__OpenIDAuthTTL__"),
						OpenIDClientId:     ptr.String("__OpenIDClientId__"),
						OpenIDIatTTL:       ptr.String("__OpenIDIatTTL__"),
						OpenIDIssueURL:     ptr.String("__OpenIDIssueURL__"),
						OpenIDProviderName: ptr.String("__OpenIDProviderName__"),
					},
				},
				{
					Mode: types.Mode("API_KEY"),
					Settings: &types.BackendAPIAppSyncAuthSettings{
						CognitoUserPoolId:  ptr.String("__CognitoUserPoolId__"),
						Description:        ptr.String("__Description__"),
						ExpirationTime:     ptr.Float64(1.0),
						OpenIDAuthTTL:      ptr.String("__OpenIDAuthTTL__"),
						OpenIDClientId:     ptr.String("__OpenIDClientId__"),
						OpenIDIatTTL:       ptr.String("__OpenIDIatTTL__"),
						OpenIDIssueURL:     ptr.String("__OpenIDIssueURL__"),
						OpenIDProviderName: ptr.String("__OpenIDProviderName__"),
					},
				},
			},
			ApiName: ptr.String("__ApiName__"),
			ConflictResolution: &types.BackendAPIConflictResolution{
				ResolutionStrategy: types.ResolutionStrategy("OPTIMISTIC_CONCURRENCY"),
			},
			DefaultAuthType: &types.BackendAPIAuthType{
				Mode: types.Mode("API_KEY"),
				Settings: &types.BackendAPIAppSyncAuthSettings{
					CognitoUserPoolId:  ptr.String("__CognitoUserPoolId__"),
					Description:        ptr.String("__Description__"),
					ExpirationTime:     ptr.Float64(1.0),
					OpenIDAuthTTL:      ptr.String("__OpenIDAuthTTL__"),
					OpenIDClientId:     ptr.String("__OpenIDClientId__"),
					OpenIDIatTTL:       ptr.String("__OpenIDIatTTL__"),
					OpenIDIssueURL:     ptr.String("__OpenIDIssueURL__"),
					OpenIDProviderName: ptr.String("__OpenIDProviderName__"),
				},
			},
			Service:         ptr.String("__Service__"),
			TransformSchema: ptr.String("__TransformSchema__"),
		},
		ResourceName: ptr.String("__ResourceName__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.CreateBackendAPI(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(), "CreateBackendAPI"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_CreateBackendAuth(t *testing.T) {
	input := &CreateBackendAuthInput{
		AppId:                  ptr.String("__AppId__"),
		BackendEnvironmentName: ptr.String("__BackendEnvironmentName__"),
		ResourceConfig: &types.CreateBackendAuthResourceConfig{
			AuthResources: types.AuthResources("USER_POOL_ONLY"),
			IdentityPoolConfigs: &types.CreateBackendAuthIdentityPoolConfig{
				IdentityPoolName:     ptr.String("__IdentityPoolName__"),
				UnauthenticatedLogin: ptr.Bool(true),
			},
			Service: types.Service("COGNITO"),
			UserPoolConfigs: &types.CreateBackendAuthUserPoolConfig{
				ForgotPassword: &types.CreateBackendAuthForgotPasswordConfig{
					DeliveryMethod: types.DeliveryMethod("EMAIL"),
					EmailSettings: &types.EmailSettings{
						EmailMessage: ptr.String("__EmailMessage__"),
						EmailSubject: ptr.String("__EmailSubject__"),
					},
					SmsSettings: &types.SmsSettings{
						SmsMessage: ptr.String("__SmsMessage__"),
					},
				},
				Mfa: &types.CreateBackendAuthMFAConfig{
					MFAMode: types.MFAMode("ON"),
					Settings: &types.Settings{
						MfaTypes: []types.MfaTypesElement{
							types.MfaTypesElement("SMS"),
							types.MfaTypesElement("SMS"),
						},
						SmsMessage: ptr.String("__SmsMessage__"),
					},
				},
				OAuth: &types.CreateBackendAuthOAuthConfig{
					DomainPrefix:   ptr.String("__DomainPrefix__"),
					OAuthGrantType: types.OAuthGrantType("CODE"),
					OAuthScopes: []types.OAuthScopesElement{
						types.OAuthScopesElement("PHONE"),
						types.OAuthScopesElement("PHONE"),
					},
					RedirectSignInURIs: []string{
						"__Member__",
						"__Member__",
					},
					RedirectSignOutURIs: []string{
						"__Member__",
						"__Member__",
					},
					SocialProviderSettings: &types.SocialProviderSettings{
						Facebook: &types.BackendAuthSocialProviderConfig{
							ClientId:     ptr.String("__ClientId__"),
							ClientSecret: ptr.String("__ClientSecret__"),
						},
						Google: &types.BackendAuthSocialProviderConfig{
							ClientId:     ptr.String("__ClientId__"),
							ClientSecret: ptr.String("__ClientSecret__"),
						},
						LoginWithAmazon: &types.BackendAuthSocialProviderConfig{
							ClientId:     ptr.String("__ClientId__"),
							ClientSecret: ptr.String("__ClientSecret__"),
						},
						SignInWithApple: &types.BackendAuthAppleProviderConfig{
							ClientId:   ptr.String("__ClientId__"),
							KeyId:      ptr.String("__KeyId__"),
							PrivateKey: ptr.String("__PrivateKey__"),
							TeamId:     ptr.String("__TeamId__"),
						},
					},
				},
				PasswordPolicy: &types.CreateBackendAuthPasswordPolicyConfig{
					AdditionalConstraints: []types.AdditionalConstraintsElement{
						types.AdditionalConstraintsElement("REQUIRE_DIGIT"),
						types.AdditionalConstraintsElement("REQUIRE_DIGIT"),
					},
					MinimumLength: ptr.Float64(1.0),
				},
				RequiredSignUpAttributes: []types.RequiredSignUpAttributesElement{
					types.RequiredSignUpAttributesElement("ADDRESS"),
					types.RequiredSignUpAttributesElement("ADDRESS"),
				},
				SignInMethod: types.SignInMethod("EMAIL"),
				UserPoolName: ptr.String("__UserPoolName__"),
				VerificationMessage: &types.CreateBackendAuthVerificationMessageConfig{
					DeliveryMethod: types.DeliveryMethod("EMAIL"),
					EmailSettings: &types.EmailSettings{
						EmailMessage: ptr.String("__EmailMessage__"),
						EmailSubject: ptr.String("__EmailSubject__"),
					},
					SmsSettings: &types.SmsSettings{
						SmsMessage: ptr.String("__SmsMessage__"),
					},
				},
			},
		},
		ResourceName: ptr.String("__ResourceName__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.CreateBackendAuth(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(), "CreateBackendAuth"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_CreateBackendConfig(t *testing.T) {
	input := &CreateBackendConfigInput{
		AppId:               ptr.String("__AppId__"),
		BackendManagerAppId: ptr.String("__BackendManagerAppId__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.CreateBackendConfig(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(), "CreateBackendConfig"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_CreateBackendStorage(t *testing.T) {
	input := &CreateBackendStorageInput{
		AppId:                  ptr.String("__AppId__"),
		BackendEnvironmentName: ptr.String("__BackendEnvironmentName__"),
		ResourceConfig: &types.CreateBackendStorageResourceConfig{
			BucketName: ptr.String("__BucketName__"),
			Permissions: &types.BackendStoragePermissions{
				Authenticated: []types.AuthenticatedElement{
					types.AuthenticatedElement("READ"),
					types.AuthenticatedElement("READ"),
				},
				UnAuthenticated: []types.UnAuthenticatedElement{
					types.UnAuthenticatedElement("READ"),
					types.UnAuthenticatedElement("READ"),
				},
			},
			ServiceName: types.ServiceName("S3"),
		},
		ResourceName: ptr.String("__ResourceName__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.CreateBackendStorage(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(), "CreateBackendStorage"); err != nil {
		t.Fatal(err)
	}
}

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

func TestCheckRequestSnapshot_DeleteBackend(t *testing.T) {
	input := &DeleteBackendInput{
		AppId:                  ptr.String("__AppId__"),
		BackendEnvironmentName: ptr.String("__BackendEnvironmentName__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.DeleteBackend(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(), "DeleteBackend"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_DeleteBackendAPI(t *testing.T) {
	input := &DeleteBackendAPIInput{
		AppId:                  ptr.String("__AppId__"),
		BackendEnvironmentName: ptr.String("__BackendEnvironmentName__"),
		ResourceConfig: &types.BackendAPIResourceConfig{
			AdditionalAuthTypes: []types.BackendAPIAuthType{
				{
					Mode: types.Mode("API_KEY"),
					Settings: &types.BackendAPIAppSyncAuthSettings{
						CognitoUserPoolId:  ptr.String("__CognitoUserPoolId__"),
						Description:        ptr.String("__Description__"),
						ExpirationTime:     ptr.Float64(1.0),
						OpenIDAuthTTL:      ptr.String("__OpenIDAuthTTL__"),
						OpenIDClientId:     ptr.String("__OpenIDClientId__"),
						OpenIDIatTTL:       ptr.String("__OpenIDIatTTL__"),
						OpenIDIssueURL:     ptr.String("__OpenIDIssueURL__"),
						OpenIDProviderName: ptr.String("__OpenIDProviderName__"),
					},
				},
				{
					Mode: types.Mode("API_KEY"),
					Settings: &types.BackendAPIAppSyncAuthSettings{
						CognitoUserPoolId:  ptr.String("__CognitoUserPoolId__"),
						Description:        ptr.String("__Description__"),
						ExpirationTime:     ptr.Float64(1.0),
						OpenIDAuthTTL:      ptr.String("__OpenIDAuthTTL__"),
						OpenIDClientId:     ptr.String("__OpenIDClientId__"),
						OpenIDIatTTL:       ptr.String("__OpenIDIatTTL__"),
						OpenIDIssueURL:     ptr.String("__OpenIDIssueURL__"),
						OpenIDProviderName: ptr.String("__OpenIDProviderName__"),
					},
				},
			},
			ApiName: ptr.String("__ApiName__"),
			ConflictResolution: &types.BackendAPIConflictResolution{
				ResolutionStrategy: types.ResolutionStrategy("OPTIMISTIC_CONCURRENCY"),
			},
			DefaultAuthType: &types.BackendAPIAuthType{
				Mode: types.Mode("API_KEY"),
				Settings: &types.BackendAPIAppSyncAuthSettings{
					CognitoUserPoolId:  ptr.String("__CognitoUserPoolId__"),
					Description:        ptr.String("__Description__"),
					ExpirationTime:     ptr.Float64(1.0),
					OpenIDAuthTTL:      ptr.String("__OpenIDAuthTTL__"),
					OpenIDClientId:     ptr.String("__OpenIDClientId__"),
					OpenIDIatTTL:       ptr.String("__OpenIDIatTTL__"),
					OpenIDIssueURL:     ptr.String("__OpenIDIssueURL__"),
					OpenIDProviderName: ptr.String("__OpenIDProviderName__"),
				},
			},
			Service:         ptr.String("__Service__"),
			TransformSchema: ptr.String("__TransformSchema__"),
		},
		ResourceName: ptr.String("__ResourceName__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.DeleteBackendAPI(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(), "DeleteBackendAPI"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_DeleteBackendAuth(t *testing.T) {
	input := &DeleteBackendAuthInput{
		AppId:                  ptr.String("__AppId__"),
		BackendEnvironmentName: ptr.String("__BackendEnvironmentName__"),
		ResourceName:           ptr.String("__ResourceName__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.DeleteBackendAuth(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(), "DeleteBackendAuth"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_DeleteBackendStorage(t *testing.T) {
	input := &DeleteBackendStorageInput{
		AppId:                  ptr.String("__AppId__"),
		BackendEnvironmentName: ptr.String("__BackendEnvironmentName__"),
		ResourceName:           ptr.String("__ResourceName__"),
		ServiceName:            types.ServiceName("S3"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.DeleteBackendStorage(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(), "DeleteBackendStorage"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_DeleteToken(t *testing.T) {
	input := &DeleteTokenInput{
		AppId:     ptr.String("__AppId__"),
		SessionId: ptr.String("__SessionId__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.DeleteToken(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(), "DeleteToken"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_GenerateBackendAPIModels(t *testing.T) {
	input := &GenerateBackendAPIModelsInput{
		AppId:                  ptr.String("__AppId__"),
		BackendEnvironmentName: ptr.String("__BackendEnvironmentName__"),
		ResourceName:           ptr.String("__ResourceName__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.GenerateBackendAPIModels(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(), "GenerateBackendAPIModels"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_GetBackend(t *testing.T) {
	input := &GetBackendInput{
		AppId:                  ptr.String("__AppId__"),
		BackendEnvironmentName: ptr.String("__BackendEnvironmentName__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.GetBackend(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(), "GetBackend"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_GetBackendAPI(t *testing.T) {
	input := &GetBackendAPIInput{
		AppId:                  ptr.String("__AppId__"),
		BackendEnvironmentName: ptr.String("__BackendEnvironmentName__"),
		ResourceConfig: &types.BackendAPIResourceConfig{
			AdditionalAuthTypes: []types.BackendAPIAuthType{
				{
					Mode: types.Mode("API_KEY"),
					Settings: &types.BackendAPIAppSyncAuthSettings{
						CognitoUserPoolId:  ptr.String("__CognitoUserPoolId__"),
						Description:        ptr.String("__Description__"),
						ExpirationTime:     ptr.Float64(1.0),
						OpenIDAuthTTL:      ptr.String("__OpenIDAuthTTL__"),
						OpenIDClientId:     ptr.String("__OpenIDClientId__"),
						OpenIDIatTTL:       ptr.String("__OpenIDIatTTL__"),
						OpenIDIssueURL:     ptr.String("__OpenIDIssueURL__"),
						OpenIDProviderName: ptr.String("__OpenIDProviderName__"),
					},
				},
				{
					Mode: types.Mode("API_KEY"),
					Settings: &types.BackendAPIAppSyncAuthSettings{
						CognitoUserPoolId:  ptr.String("__CognitoUserPoolId__"),
						Description:        ptr.String("__Description__"),
						ExpirationTime:     ptr.Float64(1.0),
						OpenIDAuthTTL:      ptr.String("__OpenIDAuthTTL__"),
						OpenIDClientId:     ptr.String("__OpenIDClientId__"),
						OpenIDIatTTL:       ptr.String("__OpenIDIatTTL__"),
						OpenIDIssueURL:     ptr.String("__OpenIDIssueURL__"),
						OpenIDProviderName: ptr.String("__OpenIDProviderName__"),
					},
				},
			},
			ApiName: ptr.String("__ApiName__"),
			ConflictResolution: &types.BackendAPIConflictResolution{
				ResolutionStrategy: types.ResolutionStrategy("OPTIMISTIC_CONCURRENCY"),
			},
			DefaultAuthType: &types.BackendAPIAuthType{
				Mode: types.Mode("API_KEY"),
				Settings: &types.BackendAPIAppSyncAuthSettings{
					CognitoUserPoolId:  ptr.String("__CognitoUserPoolId__"),
					Description:        ptr.String("__Description__"),
					ExpirationTime:     ptr.Float64(1.0),
					OpenIDAuthTTL:      ptr.String("__OpenIDAuthTTL__"),
					OpenIDClientId:     ptr.String("__OpenIDClientId__"),
					OpenIDIatTTL:       ptr.String("__OpenIDIatTTL__"),
					OpenIDIssueURL:     ptr.String("__OpenIDIssueURL__"),
					OpenIDProviderName: ptr.String("__OpenIDProviderName__"),
				},
			},
			Service:         ptr.String("__Service__"),
			TransformSchema: ptr.String("__TransformSchema__"),
		},
		ResourceName: ptr.String("__ResourceName__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.GetBackendAPI(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(), "GetBackendAPI"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_GetBackendAPIModels(t *testing.T) {
	input := &GetBackendAPIModelsInput{
		AppId:                  ptr.String("__AppId__"),
		BackendEnvironmentName: ptr.String("__BackendEnvironmentName__"),
		ResourceName:           ptr.String("__ResourceName__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.GetBackendAPIModels(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(), "GetBackendAPIModels"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_GetBackendAuth(t *testing.T) {
	input := &GetBackendAuthInput{
		AppId:                  ptr.String("__AppId__"),
		BackendEnvironmentName: ptr.String("__BackendEnvironmentName__"),
		ResourceName:           ptr.String("__ResourceName__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.GetBackendAuth(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(), "GetBackendAuth"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_GetBackendJob(t *testing.T) {
	input := &GetBackendJobInput{
		AppId:                  ptr.String("__AppId__"),
		BackendEnvironmentName: ptr.String("__BackendEnvironmentName__"),
		JobId:                  ptr.String("__JobId__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.GetBackendJob(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(), "GetBackendJob"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_GetBackendStorage(t *testing.T) {
	input := &GetBackendStorageInput{
		AppId:                  ptr.String("__AppId__"),
		BackendEnvironmentName: ptr.String("__BackendEnvironmentName__"),
		ResourceName:           ptr.String("__ResourceName__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.GetBackendStorage(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(), "GetBackendStorage"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_GetToken(t *testing.T) {
	input := &GetTokenInput{
		AppId:     ptr.String("__AppId__"),
		SessionId: ptr.String("__SessionId__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.GetToken(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(), "GetToken"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_ImportBackendAuth(t *testing.T) {
	input := &ImportBackendAuthInput{
		AppId:                  ptr.String("__AppId__"),
		BackendEnvironmentName: ptr.String("__BackendEnvironmentName__"),
		IdentityPoolId:         ptr.String("__IdentityPoolId__"),
		NativeClientId:         ptr.String("__NativeClientId__"),
		UserPoolId:             ptr.String("__UserPoolId__"),
		WebClientId:            ptr.String("__WebClientId__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.ImportBackendAuth(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(), "ImportBackendAuth"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_ImportBackendStorage(t *testing.T) {
	input := &ImportBackendStorageInput{
		AppId:                  ptr.String("__AppId__"),
		BackendEnvironmentName: ptr.String("__BackendEnvironmentName__"),
		BucketName:             ptr.String("__BucketName__"),
		ServiceName:            types.ServiceName("S3"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.ImportBackendStorage(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(), "ImportBackendStorage"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_ListBackendJobs(t *testing.T) {
	input := &ListBackendJobsInput{
		AppId:                  ptr.String("__AppId__"),
		BackendEnvironmentName: ptr.String("__BackendEnvironmentName__"),
		JobId:                  ptr.String("__JobId__"),
		MaxResults:             ptr.Int32(1),
		NextToken:              ptr.String("__NextToken__"),
		Operation:              ptr.String("__Operation__"),
		Status:                 ptr.String("__Status__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.ListBackendJobs(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(), "ListBackendJobs"); err != nil {
		t.Fatal(err)
	}
}

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

func TestCheckRequestSnapshot_RemoveAllBackends(t *testing.T) {
	input := &RemoveAllBackendsInput{
		AppId:           ptr.String("__AppId__"),
		CleanAmplifyApp: ptr.Bool(true),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.RemoveAllBackends(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(), "RemoveAllBackends"); err != nil {
		t.Fatal(err)
	}
}

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

func TestCheckRequestSnapshot_UpdateBackendAPI(t *testing.T) {
	input := &UpdateBackendAPIInput{
		AppId:                  ptr.String("__AppId__"),
		BackendEnvironmentName: ptr.String("__BackendEnvironmentName__"),
		ResourceConfig: &types.BackendAPIResourceConfig{
			AdditionalAuthTypes: []types.BackendAPIAuthType{
				{
					Mode: types.Mode("API_KEY"),
					Settings: &types.BackendAPIAppSyncAuthSettings{
						CognitoUserPoolId:  ptr.String("__CognitoUserPoolId__"),
						Description:        ptr.String("__Description__"),
						ExpirationTime:     ptr.Float64(1.0),
						OpenIDAuthTTL:      ptr.String("__OpenIDAuthTTL__"),
						OpenIDClientId:     ptr.String("__OpenIDClientId__"),
						OpenIDIatTTL:       ptr.String("__OpenIDIatTTL__"),
						OpenIDIssueURL:     ptr.String("__OpenIDIssueURL__"),
						OpenIDProviderName: ptr.String("__OpenIDProviderName__"),
					},
				},
				{
					Mode: types.Mode("API_KEY"),
					Settings: &types.BackendAPIAppSyncAuthSettings{
						CognitoUserPoolId:  ptr.String("__CognitoUserPoolId__"),
						Description:        ptr.String("__Description__"),
						ExpirationTime:     ptr.Float64(1.0),
						OpenIDAuthTTL:      ptr.String("__OpenIDAuthTTL__"),
						OpenIDClientId:     ptr.String("__OpenIDClientId__"),
						OpenIDIatTTL:       ptr.String("__OpenIDIatTTL__"),
						OpenIDIssueURL:     ptr.String("__OpenIDIssueURL__"),
						OpenIDProviderName: ptr.String("__OpenIDProviderName__"),
					},
				},
			},
			ApiName: ptr.String("__ApiName__"),
			ConflictResolution: &types.BackendAPIConflictResolution{
				ResolutionStrategy: types.ResolutionStrategy("OPTIMISTIC_CONCURRENCY"),
			},
			DefaultAuthType: &types.BackendAPIAuthType{
				Mode: types.Mode("API_KEY"),
				Settings: &types.BackendAPIAppSyncAuthSettings{
					CognitoUserPoolId:  ptr.String("__CognitoUserPoolId__"),
					Description:        ptr.String("__Description__"),
					ExpirationTime:     ptr.Float64(1.0),
					OpenIDAuthTTL:      ptr.String("__OpenIDAuthTTL__"),
					OpenIDClientId:     ptr.String("__OpenIDClientId__"),
					OpenIDIatTTL:       ptr.String("__OpenIDIatTTL__"),
					OpenIDIssueURL:     ptr.String("__OpenIDIssueURL__"),
					OpenIDProviderName: ptr.String("__OpenIDProviderName__"),
				},
			},
			Service:         ptr.String("__Service__"),
			TransformSchema: ptr.String("__TransformSchema__"),
		},
		ResourceName: ptr.String("__ResourceName__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.UpdateBackendAPI(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(), "UpdateBackendAPI"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_UpdateBackendAuth(t *testing.T) {
	input := &UpdateBackendAuthInput{
		AppId:                  ptr.String("__AppId__"),
		BackendEnvironmentName: ptr.String("__BackendEnvironmentName__"),
		ResourceConfig: &types.UpdateBackendAuthResourceConfig{
			AuthResources: types.AuthResources("USER_POOL_ONLY"),
			IdentityPoolConfigs: &types.UpdateBackendAuthIdentityPoolConfig{
				UnauthenticatedLogin: ptr.Bool(true),
			},
			Service: types.Service("COGNITO"),
			UserPoolConfigs: &types.UpdateBackendAuthUserPoolConfig{
				ForgotPassword: &types.UpdateBackendAuthForgotPasswordConfig{
					DeliveryMethod: types.DeliveryMethod("EMAIL"),
					EmailSettings: &types.EmailSettings{
						EmailMessage: ptr.String("__EmailMessage__"),
						EmailSubject: ptr.String("__EmailSubject__"),
					},
					SmsSettings: &types.SmsSettings{
						SmsMessage: ptr.String("__SmsMessage__"),
					},
				},
				Mfa: &types.UpdateBackendAuthMFAConfig{
					MFAMode: types.MFAMode("ON"),
					Settings: &types.Settings{
						MfaTypes: []types.MfaTypesElement{
							types.MfaTypesElement("SMS"),
							types.MfaTypesElement("SMS"),
						},
						SmsMessage: ptr.String("__SmsMessage__"),
					},
				},
				OAuth: &types.UpdateBackendAuthOAuthConfig{
					DomainPrefix:   ptr.String("__DomainPrefix__"),
					OAuthGrantType: types.OAuthGrantType("CODE"),
					OAuthScopes: []types.OAuthScopesElement{
						types.OAuthScopesElement("PHONE"),
						types.OAuthScopesElement("PHONE"),
					},
					RedirectSignInURIs: []string{
						"__Member__",
						"__Member__",
					},
					RedirectSignOutURIs: []string{
						"__Member__",
						"__Member__",
					},
					SocialProviderSettings: &types.SocialProviderSettings{
						Facebook: &types.BackendAuthSocialProviderConfig{
							ClientId:     ptr.String("__ClientId__"),
							ClientSecret: ptr.String("__ClientSecret__"),
						},
						Google: &types.BackendAuthSocialProviderConfig{
							ClientId:     ptr.String("__ClientId__"),
							ClientSecret: ptr.String("__ClientSecret__"),
						},
						LoginWithAmazon: &types.BackendAuthSocialProviderConfig{
							ClientId:     ptr.String("__ClientId__"),
							ClientSecret: ptr.String("__ClientSecret__"),
						},
						SignInWithApple: &types.BackendAuthAppleProviderConfig{
							ClientId:   ptr.String("__ClientId__"),
							KeyId:      ptr.String("__KeyId__"),
							PrivateKey: ptr.String("__PrivateKey__"),
							TeamId:     ptr.String("__TeamId__"),
						},
					},
				},
				PasswordPolicy: &types.UpdateBackendAuthPasswordPolicyConfig{
					AdditionalConstraints: []types.AdditionalConstraintsElement{
						types.AdditionalConstraintsElement("REQUIRE_DIGIT"),
						types.AdditionalConstraintsElement("REQUIRE_DIGIT"),
					},
					MinimumLength: ptr.Float64(1.0),
				},
				VerificationMessage: &types.UpdateBackendAuthVerificationMessageConfig{
					DeliveryMethod: types.DeliveryMethod("EMAIL"),
					EmailSettings: &types.EmailSettings{
						EmailMessage: ptr.String("__EmailMessage__"),
						EmailSubject: ptr.String("__EmailSubject__"),
					},
					SmsSettings: &types.SmsSettings{
						SmsMessage: ptr.String("__SmsMessage__"),
					},
				},
			},
		},
		ResourceName: ptr.String("__ResourceName__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.UpdateBackendAuth(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(), "UpdateBackendAuth"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_UpdateBackendConfig(t *testing.T) {
	input := &UpdateBackendConfigInput{
		AppId: ptr.String("__AppId__"),
		LoginAuthConfig: &types.LoginAuthConfigReqObj{
			AwsCognitoIdentityPoolId: ptr.String("__AwsCognitoIdentityPoolId__"),
			AwsCognitoRegion:         ptr.String("__AwsCognitoRegion__"),
			AwsUserPoolsId:           ptr.String("__AwsUserPoolsId__"),
			AwsUserPoolsWebClientId:  ptr.String("__AwsUserPoolsWebClientId__"),
		},
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.UpdateBackendConfig(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(), "UpdateBackendConfig"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_UpdateBackendJob(t *testing.T) {
	input := &UpdateBackendJobInput{
		AppId:                  ptr.String("__AppId__"),
		BackendEnvironmentName: ptr.String("__BackendEnvironmentName__"),
		JobId:                  ptr.String("__JobId__"),
		Operation:              ptr.String("__Operation__"),
		Status:                 ptr.String("__Status__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.UpdateBackendJob(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(), "UpdateBackendJob"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_UpdateBackendStorage(t *testing.T) {
	input := &UpdateBackendStorageInput{
		AppId:                  ptr.String("__AppId__"),
		BackendEnvironmentName: ptr.String("__BackendEnvironmentName__"),
		ResourceConfig: &types.UpdateBackendStorageResourceConfig{
			Permissions: &types.BackendStoragePermissions{
				Authenticated: []types.AuthenticatedElement{
					types.AuthenticatedElement("READ"),
					types.AuthenticatedElement("READ"),
				},
				UnAuthenticated: []types.UnAuthenticatedElement{
					types.UnAuthenticatedElement("READ"),
					types.UnAuthenticatedElement("READ"),
				},
			},
			ServiceName: types.ServiceName("S3"),
		},
		ResourceName: ptr.String("__ResourceName__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.UpdateBackendStorage(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(), "UpdateBackendStorage"); err != nil {
		t.Fatal(err)
	}
}
func TestUpdateRequestSnapshot_CloneBackend(t *testing.T) {
	input := &CloneBackendInput{
		AppId:                  ptr.String("__AppId__"),
		BackendEnvironmentName: ptr.String("__BackendEnvironmentName__"),
		TargetEnvironmentName:  ptr.String("__TargetEnvironmentName__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.CloneBackend(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(), "CloneBackend"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_CreateBackend(t *testing.T) {
	input := &CreateBackendInput{
		AppId:                  ptr.String("__AppId__"),
		AppName:                ptr.String("__AppName__"),
		BackendEnvironmentName: ptr.String("__BackendEnvironmentName__"),
		ResourceConfig:         &types.ResourceConfig{},
		ResourceName:           ptr.String("__ResourceName__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.CreateBackend(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(), "CreateBackend"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_CreateBackendAPI(t *testing.T) {
	input := &CreateBackendAPIInput{
		AppId:                  ptr.String("__AppId__"),
		BackendEnvironmentName: ptr.String("__BackendEnvironmentName__"),
		ResourceConfig: &types.BackendAPIResourceConfig{
			AdditionalAuthTypes: []types.BackendAPIAuthType{
				{
					Mode: types.Mode("API_KEY"),
					Settings: &types.BackendAPIAppSyncAuthSettings{
						CognitoUserPoolId:  ptr.String("__CognitoUserPoolId__"),
						Description:        ptr.String("__Description__"),
						ExpirationTime:     ptr.Float64(1.0),
						OpenIDAuthTTL:      ptr.String("__OpenIDAuthTTL__"),
						OpenIDClientId:     ptr.String("__OpenIDClientId__"),
						OpenIDIatTTL:       ptr.String("__OpenIDIatTTL__"),
						OpenIDIssueURL:     ptr.String("__OpenIDIssueURL__"),
						OpenIDProviderName: ptr.String("__OpenIDProviderName__"),
					},
				},
				{
					Mode: types.Mode("API_KEY"),
					Settings: &types.BackendAPIAppSyncAuthSettings{
						CognitoUserPoolId:  ptr.String("__CognitoUserPoolId__"),
						Description:        ptr.String("__Description__"),
						ExpirationTime:     ptr.Float64(1.0),
						OpenIDAuthTTL:      ptr.String("__OpenIDAuthTTL__"),
						OpenIDClientId:     ptr.String("__OpenIDClientId__"),
						OpenIDIatTTL:       ptr.String("__OpenIDIatTTL__"),
						OpenIDIssueURL:     ptr.String("__OpenIDIssueURL__"),
						OpenIDProviderName: ptr.String("__OpenIDProviderName__"),
					},
				},
			},
			ApiName: ptr.String("__ApiName__"),
			ConflictResolution: &types.BackendAPIConflictResolution{
				ResolutionStrategy: types.ResolutionStrategy("OPTIMISTIC_CONCURRENCY"),
			},
			DefaultAuthType: &types.BackendAPIAuthType{
				Mode: types.Mode("API_KEY"),
				Settings: &types.BackendAPIAppSyncAuthSettings{
					CognitoUserPoolId:  ptr.String("__CognitoUserPoolId__"),
					Description:        ptr.String("__Description__"),
					ExpirationTime:     ptr.Float64(1.0),
					OpenIDAuthTTL:      ptr.String("__OpenIDAuthTTL__"),
					OpenIDClientId:     ptr.String("__OpenIDClientId__"),
					OpenIDIatTTL:       ptr.String("__OpenIDIatTTL__"),
					OpenIDIssueURL:     ptr.String("__OpenIDIssueURL__"),
					OpenIDProviderName: ptr.String("__OpenIDProviderName__"),
				},
			},
			Service:         ptr.String("__Service__"),
			TransformSchema: ptr.String("__TransformSchema__"),
		},
		ResourceName: ptr.String("__ResourceName__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.CreateBackendAPI(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(), "CreateBackendAPI"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_CreateBackendAuth(t *testing.T) {
	input := &CreateBackendAuthInput{
		AppId:                  ptr.String("__AppId__"),
		BackendEnvironmentName: ptr.String("__BackendEnvironmentName__"),
		ResourceConfig: &types.CreateBackendAuthResourceConfig{
			AuthResources: types.AuthResources("USER_POOL_ONLY"),
			IdentityPoolConfigs: &types.CreateBackendAuthIdentityPoolConfig{
				IdentityPoolName:     ptr.String("__IdentityPoolName__"),
				UnauthenticatedLogin: ptr.Bool(true),
			},
			Service: types.Service("COGNITO"),
			UserPoolConfigs: &types.CreateBackendAuthUserPoolConfig{
				ForgotPassword: &types.CreateBackendAuthForgotPasswordConfig{
					DeliveryMethod: types.DeliveryMethod("EMAIL"),
					EmailSettings: &types.EmailSettings{
						EmailMessage: ptr.String("__EmailMessage__"),
						EmailSubject: ptr.String("__EmailSubject__"),
					},
					SmsSettings: &types.SmsSettings{
						SmsMessage: ptr.String("__SmsMessage__"),
					},
				},
				Mfa: &types.CreateBackendAuthMFAConfig{
					MFAMode: types.MFAMode("ON"),
					Settings: &types.Settings{
						MfaTypes: []types.MfaTypesElement{
							types.MfaTypesElement("SMS"),
							types.MfaTypesElement("SMS"),
						},
						SmsMessage: ptr.String("__SmsMessage__"),
					},
				},
				OAuth: &types.CreateBackendAuthOAuthConfig{
					DomainPrefix:   ptr.String("__DomainPrefix__"),
					OAuthGrantType: types.OAuthGrantType("CODE"),
					OAuthScopes: []types.OAuthScopesElement{
						types.OAuthScopesElement("PHONE"),
						types.OAuthScopesElement("PHONE"),
					},
					RedirectSignInURIs: []string{
						"__Member__",
						"__Member__",
					},
					RedirectSignOutURIs: []string{
						"__Member__",
						"__Member__",
					},
					SocialProviderSettings: &types.SocialProviderSettings{
						Facebook: &types.BackendAuthSocialProviderConfig{
							ClientId:     ptr.String("__ClientId__"),
							ClientSecret: ptr.String("__ClientSecret__"),
						},
						Google: &types.BackendAuthSocialProviderConfig{
							ClientId:     ptr.String("__ClientId__"),
							ClientSecret: ptr.String("__ClientSecret__"),
						},
						LoginWithAmazon: &types.BackendAuthSocialProviderConfig{
							ClientId:     ptr.String("__ClientId__"),
							ClientSecret: ptr.String("__ClientSecret__"),
						},
						SignInWithApple: &types.BackendAuthAppleProviderConfig{
							ClientId:   ptr.String("__ClientId__"),
							KeyId:      ptr.String("__KeyId__"),
							PrivateKey: ptr.String("__PrivateKey__"),
							TeamId:     ptr.String("__TeamId__"),
						},
					},
				},
				PasswordPolicy: &types.CreateBackendAuthPasswordPolicyConfig{
					AdditionalConstraints: []types.AdditionalConstraintsElement{
						types.AdditionalConstraintsElement("REQUIRE_DIGIT"),
						types.AdditionalConstraintsElement("REQUIRE_DIGIT"),
					},
					MinimumLength: ptr.Float64(1.0),
				},
				RequiredSignUpAttributes: []types.RequiredSignUpAttributesElement{
					types.RequiredSignUpAttributesElement("ADDRESS"),
					types.RequiredSignUpAttributesElement("ADDRESS"),
				},
				SignInMethod: types.SignInMethod("EMAIL"),
				UserPoolName: ptr.String("__UserPoolName__"),
				VerificationMessage: &types.CreateBackendAuthVerificationMessageConfig{
					DeliveryMethod: types.DeliveryMethod("EMAIL"),
					EmailSettings: &types.EmailSettings{
						EmailMessage: ptr.String("__EmailMessage__"),
						EmailSubject: ptr.String("__EmailSubject__"),
					},
					SmsSettings: &types.SmsSettings{
						SmsMessage: ptr.String("__SmsMessage__"),
					},
				},
			},
		},
		ResourceName: ptr.String("__ResourceName__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.CreateBackendAuth(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(), "CreateBackendAuth"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_CreateBackendConfig(t *testing.T) {
	input := &CreateBackendConfigInput{
		AppId:               ptr.String("__AppId__"),
		BackendManagerAppId: ptr.String("__BackendManagerAppId__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.CreateBackendConfig(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(), "CreateBackendConfig"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_CreateBackendStorage(t *testing.T) {
	input := &CreateBackendStorageInput{
		AppId:                  ptr.String("__AppId__"),
		BackendEnvironmentName: ptr.String("__BackendEnvironmentName__"),
		ResourceConfig: &types.CreateBackendStorageResourceConfig{
			BucketName: ptr.String("__BucketName__"),
			Permissions: &types.BackendStoragePermissions{
				Authenticated: []types.AuthenticatedElement{
					types.AuthenticatedElement("READ"),
					types.AuthenticatedElement("READ"),
				},
				UnAuthenticated: []types.UnAuthenticatedElement{
					types.UnAuthenticatedElement("READ"),
					types.UnAuthenticatedElement("READ"),
				},
			},
			ServiceName: types.ServiceName("S3"),
		},
		ResourceName: ptr.String("__ResourceName__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.CreateBackendStorage(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(), "CreateBackendStorage"); err != nil {
		t.Fatal(err)
	}
}

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

func TestUpdateRequestSnapshot_DeleteBackend(t *testing.T) {
	input := &DeleteBackendInput{
		AppId:                  ptr.String("__AppId__"),
		BackendEnvironmentName: ptr.String("__BackendEnvironmentName__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.DeleteBackend(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(), "DeleteBackend"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_DeleteBackendAPI(t *testing.T) {
	input := &DeleteBackendAPIInput{
		AppId:                  ptr.String("__AppId__"),
		BackendEnvironmentName: ptr.String("__BackendEnvironmentName__"),
		ResourceConfig: &types.BackendAPIResourceConfig{
			AdditionalAuthTypes: []types.BackendAPIAuthType{
				{
					Mode: types.Mode("API_KEY"),
					Settings: &types.BackendAPIAppSyncAuthSettings{
						CognitoUserPoolId:  ptr.String("__CognitoUserPoolId__"),
						Description:        ptr.String("__Description__"),
						ExpirationTime:     ptr.Float64(1.0),
						OpenIDAuthTTL:      ptr.String("__OpenIDAuthTTL__"),
						OpenIDClientId:     ptr.String("__OpenIDClientId__"),
						OpenIDIatTTL:       ptr.String("__OpenIDIatTTL__"),
						OpenIDIssueURL:     ptr.String("__OpenIDIssueURL__"),
						OpenIDProviderName: ptr.String("__OpenIDProviderName__"),
					},
				},
				{
					Mode: types.Mode("API_KEY"),
					Settings: &types.BackendAPIAppSyncAuthSettings{
						CognitoUserPoolId:  ptr.String("__CognitoUserPoolId__"),
						Description:        ptr.String("__Description__"),
						ExpirationTime:     ptr.Float64(1.0),
						OpenIDAuthTTL:      ptr.String("__OpenIDAuthTTL__"),
						OpenIDClientId:     ptr.String("__OpenIDClientId__"),
						OpenIDIatTTL:       ptr.String("__OpenIDIatTTL__"),
						OpenIDIssueURL:     ptr.String("__OpenIDIssueURL__"),
						OpenIDProviderName: ptr.String("__OpenIDProviderName__"),
					},
				},
			},
			ApiName: ptr.String("__ApiName__"),
			ConflictResolution: &types.BackendAPIConflictResolution{
				ResolutionStrategy: types.ResolutionStrategy("OPTIMISTIC_CONCURRENCY"),
			},
			DefaultAuthType: &types.BackendAPIAuthType{
				Mode: types.Mode("API_KEY"),
				Settings: &types.BackendAPIAppSyncAuthSettings{
					CognitoUserPoolId:  ptr.String("__CognitoUserPoolId__"),
					Description:        ptr.String("__Description__"),
					ExpirationTime:     ptr.Float64(1.0),
					OpenIDAuthTTL:      ptr.String("__OpenIDAuthTTL__"),
					OpenIDClientId:     ptr.String("__OpenIDClientId__"),
					OpenIDIatTTL:       ptr.String("__OpenIDIatTTL__"),
					OpenIDIssueURL:     ptr.String("__OpenIDIssueURL__"),
					OpenIDProviderName: ptr.String("__OpenIDProviderName__"),
				},
			},
			Service:         ptr.String("__Service__"),
			TransformSchema: ptr.String("__TransformSchema__"),
		},
		ResourceName: ptr.String("__ResourceName__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.DeleteBackendAPI(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(), "DeleteBackendAPI"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_DeleteBackendAuth(t *testing.T) {
	input := &DeleteBackendAuthInput{
		AppId:                  ptr.String("__AppId__"),
		BackendEnvironmentName: ptr.String("__BackendEnvironmentName__"),
		ResourceName:           ptr.String("__ResourceName__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.DeleteBackendAuth(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(), "DeleteBackendAuth"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_DeleteBackendStorage(t *testing.T) {
	input := &DeleteBackendStorageInput{
		AppId:                  ptr.String("__AppId__"),
		BackendEnvironmentName: ptr.String("__BackendEnvironmentName__"),
		ResourceName:           ptr.String("__ResourceName__"),
		ServiceName:            types.ServiceName("S3"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.DeleteBackendStorage(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(), "DeleteBackendStorage"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_DeleteToken(t *testing.T) {
	input := &DeleteTokenInput{
		AppId:     ptr.String("__AppId__"),
		SessionId: ptr.String("__SessionId__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.DeleteToken(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(), "DeleteToken"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_GenerateBackendAPIModels(t *testing.T) {
	input := &GenerateBackendAPIModelsInput{
		AppId:                  ptr.String("__AppId__"),
		BackendEnvironmentName: ptr.String("__BackendEnvironmentName__"),
		ResourceName:           ptr.String("__ResourceName__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.GenerateBackendAPIModels(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(), "GenerateBackendAPIModels"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_GetBackend(t *testing.T) {
	input := &GetBackendInput{
		AppId:                  ptr.String("__AppId__"),
		BackendEnvironmentName: ptr.String("__BackendEnvironmentName__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.GetBackend(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(), "GetBackend"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_GetBackendAPI(t *testing.T) {
	input := &GetBackendAPIInput{
		AppId:                  ptr.String("__AppId__"),
		BackendEnvironmentName: ptr.String("__BackendEnvironmentName__"),
		ResourceConfig: &types.BackendAPIResourceConfig{
			AdditionalAuthTypes: []types.BackendAPIAuthType{
				{
					Mode: types.Mode("API_KEY"),
					Settings: &types.BackendAPIAppSyncAuthSettings{
						CognitoUserPoolId:  ptr.String("__CognitoUserPoolId__"),
						Description:        ptr.String("__Description__"),
						ExpirationTime:     ptr.Float64(1.0),
						OpenIDAuthTTL:      ptr.String("__OpenIDAuthTTL__"),
						OpenIDClientId:     ptr.String("__OpenIDClientId__"),
						OpenIDIatTTL:       ptr.String("__OpenIDIatTTL__"),
						OpenIDIssueURL:     ptr.String("__OpenIDIssueURL__"),
						OpenIDProviderName: ptr.String("__OpenIDProviderName__"),
					},
				},
				{
					Mode: types.Mode("API_KEY"),
					Settings: &types.BackendAPIAppSyncAuthSettings{
						CognitoUserPoolId:  ptr.String("__CognitoUserPoolId__"),
						Description:        ptr.String("__Description__"),
						ExpirationTime:     ptr.Float64(1.0),
						OpenIDAuthTTL:      ptr.String("__OpenIDAuthTTL__"),
						OpenIDClientId:     ptr.String("__OpenIDClientId__"),
						OpenIDIatTTL:       ptr.String("__OpenIDIatTTL__"),
						OpenIDIssueURL:     ptr.String("__OpenIDIssueURL__"),
						OpenIDProviderName: ptr.String("__OpenIDProviderName__"),
					},
				},
			},
			ApiName: ptr.String("__ApiName__"),
			ConflictResolution: &types.BackendAPIConflictResolution{
				ResolutionStrategy: types.ResolutionStrategy("OPTIMISTIC_CONCURRENCY"),
			},
			DefaultAuthType: &types.BackendAPIAuthType{
				Mode: types.Mode("API_KEY"),
				Settings: &types.BackendAPIAppSyncAuthSettings{
					CognitoUserPoolId:  ptr.String("__CognitoUserPoolId__"),
					Description:        ptr.String("__Description__"),
					ExpirationTime:     ptr.Float64(1.0),
					OpenIDAuthTTL:      ptr.String("__OpenIDAuthTTL__"),
					OpenIDClientId:     ptr.String("__OpenIDClientId__"),
					OpenIDIatTTL:       ptr.String("__OpenIDIatTTL__"),
					OpenIDIssueURL:     ptr.String("__OpenIDIssueURL__"),
					OpenIDProviderName: ptr.String("__OpenIDProviderName__"),
				},
			},
			Service:         ptr.String("__Service__"),
			TransformSchema: ptr.String("__TransformSchema__"),
		},
		ResourceName: ptr.String("__ResourceName__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.GetBackendAPI(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(), "GetBackendAPI"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_GetBackendAPIModels(t *testing.T) {
	input := &GetBackendAPIModelsInput{
		AppId:                  ptr.String("__AppId__"),
		BackendEnvironmentName: ptr.String("__BackendEnvironmentName__"),
		ResourceName:           ptr.String("__ResourceName__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.GetBackendAPIModels(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(), "GetBackendAPIModels"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_GetBackendAuth(t *testing.T) {
	input := &GetBackendAuthInput{
		AppId:                  ptr.String("__AppId__"),
		BackendEnvironmentName: ptr.String("__BackendEnvironmentName__"),
		ResourceName:           ptr.String("__ResourceName__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.GetBackendAuth(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(), "GetBackendAuth"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_GetBackendJob(t *testing.T) {
	input := &GetBackendJobInput{
		AppId:                  ptr.String("__AppId__"),
		BackendEnvironmentName: ptr.String("__BackendEnvironmentName__"),
		JobId:                  ptr.String("__JobId__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.GetBackendJob(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(), "GetBackendJob"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_GetBackendStorage(t *testing.T) {
	input := &GetBackendStorageInput{
		AppId:                  ptr.String("__AppId__"),
		BackendEnvironmentName: ptr.String("__BackendEnvironmentName__"),
		ResourceName:           ptr.String("__ResourceName__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.GetBackendStorage(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(), "GetBackendStorage"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_GetToken(t *testing.T) {
	input := &GetTokenInput{
		AppId:     ptr.String("__AppId__"),
		SessionId: ptr.String("__SessionId__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.GetToken(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(), "GetToken"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_ImportBackendAuth(t *testing.T) {
	input := &ImportBackendAuthInput{
		AppId:                  ptr.String("__AppId__"),
		BackendEnvironmentName: ptr.String("__BackendEnvironmentName__"),
		IdentityPoolId:         ptr.String("__IdentityPoolId__"),
		NativeClientId:         ptr.String("__NativeClientId__"),
		UserPoolId:             ptr.String("__UserPoolId__"),
		WebClientId:            ptr.String("__WebClientId__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.ImportBackendAuth(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(), "ImportBackendAuth"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_ImportBackendStorage(t *testing.T) {
	input := &ImportBackendStorageInput{
		AppId:                  ptr.String("__AppId__"),
		BackendEnvironmentName: ptr.String("__BackendEnvironmentName__"),
		BucketName:             ptr.String("__BucketName__"),
		ServiceName:            types.ServiceName("S3"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.ImportBackendStorage(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(), "ImportBackendStorage"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_ListBackendJobs(t *testing.T) {
	input := &ListBackendJobsInput{
		AppId:                  ptr.String("__AppId__"),
		BackendEnvironmentName: ptr.String("__BackendEnvironmentName__"),
		JobId:                  ptr.String("__JobId__"),
		MaxResults:             ptr.Int32(1),
		NextToken:              ptr.String("__NextToken__"),
		Operation:              ptr.String("__Operation__"),
		Status:                 ptr.String("__Status__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.ListBackendJobs(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(), "ListBackendJobs"); err != nil {
		t.Fatal(err)
	}
}

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

func TestUpdateRequestSnapshot_RemoveAllBackends(t *testing.T) {
	input := &RemoveAllBackendsInput{
		AppId:           ptr.String("__AppId__"),
		CleanAmplifyApp: ptr.Bool(true),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.RemoveAllBackends(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(), "RemoveAllBackends"); err != nil {
		t.Fatal(err)
	}
}

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

func TestUpdateRequestSnapshot_UpdateBackendAPI(t *testing.T) {
	input := &UpdateBackendAPIInput{
		AppId:                  ptr.String("__AppId__"),
		BackendEnvironmentName: ptr.String("__BackendEnvironmentName__"),
		ResourceConfig: &types.BackendAPIResourceConfig{
			AdditionalAuthTypes: []types.BackendAPIAuthType{
				{
					Mode: types.Mode("API_KEY"),
					Settings: &types.BackendAPIAppSyncAuthSettings{
						CognitoUserPoolId:  ptr.String("__CognitoUserPoolId__"),
						Description:        ptr.String("__Description__"),
						ExpirationTime:     ptr.Float64(1.0),
						OpenIDAuthTTL:      ptr.String("__OpenIDAuthTTL__"),
						OpenIDClientId:     ptr.String("__OpenIDClientId__"),
						OpenIDIatTTL:       ptr.String("__OpenIDIatTTL__"),
						OpenIDIssueURL:     ptr.String("__OpenIDIssueURL__"),
						OpenIDProviderName: ptr.String("__OpenIDProviderName__"),
					},
				},
				{
					Mode: types.Mode("API_KEY"),
					Settings: &types.BackendAPIAppSyncAuthSettings{
						CognitoUserPoolId:  ptr.String("__CognitoUserPoolId__"),
						Description:        ptr.String("__Description__"),
						ExpirationTime:     ptr.Float64(1.0),
						OpenIDAuthTTL:      ptr.String("__OpenIDAuthTTL__"),
						OpenIDClientId:     ptr.String("__OpenIDClientId__"),
						OpenIDIatTTL:       ptr.String("__OpenIDIatTTL__"),
						OpenIDIssueURL:     ptr.String("__OpenIDIssueURL__"),
						OpenIDProviderName: ptr.String("__OpenIDProviderName__"),
					},
				},
			},
			ApiName: ptr.String("__ApiName__"),
			ConflictResolution: &types.BackendAPIConflictResolution{
				ResolutionStrategy: types.ResolutionStrategy("OPTIMISTIC_CONCURRENCY"),
			},
			DefaultAuthType: &types.BackendAPIAuthType{
				Mode: types.Mode("API_KEY"),
				Settings: &types.BackendAPIAppSyncAuthSettings{
					CognitoUserPoolId:  ptr.String("__CognitoUserPoolId__"),
					Description:        ptr.String("__Description__"),
					ExpirationTime:     ptr.Float64(1.0),
					OpenIDAuthTTL:      ptr.String("__OpenIDAuthTTL__"),
					OpenIDClientId:     ptr.String("__OpenIDClientId__"),
					OpenIDIatTTL:       ptr.String("__OpenIDIatTTL__"),
					OpenIDIssueURL:     ptr.String("__OpenIDIssueURL__"),
					OpenIDProviderName: ptr.String("__OpenIDProviderName__"),
				},
			},
			Service:         ptr.String("__Service__"),
			TransformSchema: ptr.String("__TransformSchema__"),
		},
		ResourceName: ptr.String("__ResourceName__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.UpdateBackendAPI(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(), "UpdateBackendAPI"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_UpdateBackendAuth(t *testing.T) {
	input := &UpdateBackendAuthInput{
		AppId:                  ptr.String("__AppId__"),
		BackendEnvironmentName: ptr.String("__BackendEnvironmentName__"),
		ResourceConfig: &types.UpdateBackendAuthResourceConfig{
			AuthResources: types.AuthResources("USER_POOL_ONLY"),
			IdentityPoolConfigs: &types.UpdateBackendAuthIdentityPoolConfig{
				UnauthenticatedLogin: ptr.Bool(true),
			},
			Service: types.Service("COGNITO"),
			UserPoolConfigs: &types.UpdateBackendAuthUserPoolConfig{
				ForgotPassword: &types.UpdateBackendAuthForgotPasswordConfig{
					DeliveryMethod: types.DeliveryMethod("EMAIL"),
					EmailSettings: &types.EmailSettings{
						EmailMessage: ptr.String("__EmailMessage__"),
						EmailSubject: ptr.String("__EmailSubject__"),
					},
					SmsSettings: &types.SmsSettings{
						SmsMessage: ptr.String("__SmsMessage__"),
					},
				},
				Mfa: &types.UpdateBackendAuthMFAConfig{
					MFAMode: types.MFAMode("ON"),
					Settings: &types.Settings{
						MfaTypes: []types.MfaTypesElement{
							types.MfaTypesElement("SMS"),
							types.MfaTypesElement("SMS"),
						},
						SmsMessage: ptr.String("__SmsMessage__"),
					},
				},
				OAuth: &types.UpdateBackendAuthOAuthConfig{
					DomainPrefix:   ptr.String("__DomainPrefix__"),
					OAuthGrantType: types.OAuthGrantType("CODE"),
					OAuthScopes: []types.OAuthScopesElement{
						types.OAuthScopesElement("PHONE"),
						types.OAuthScopesElement("PHONE"),
					},
					RedirectSignInURIs: []string{
						"__Member__",
						"__Member__",
					},
					RedirectSignOutURIs: []string{
						"__Member__",
						"__Member__",
					},
					SocialProviderSettings: &types.SocialProviderSettings{
						Facebook: &types.BackendAuthSocialProviderConfig{
							ClientId:     ptr.String("__ClientId__"),
							ClientSecret: ptr.String("__ClientSecret__"),
						},
						Google: &types.BackendAuthSocialProviderConfig{
							ClientId:     ptr.String("__ClientId__"),
							ClientSecret: ptr.String("__ClientSecret__"),
						},
						LoginWithAmazon: &types.BackendAuthSocialProviderConfig{
							ClientId:     ptr.String("__ClientId__"),
							ClientSecret: ptr.String("__ClientSecret__"),
						},
						SignInWithApple: &types.BackendAuthAppleProviderConfig{
							ClientId:   ptr.String("__ClientId__"),
							KeyId:      ptr.String("__KeyId__"),
							PrivateKey: ptr.String("__PrivateKey__"),
							TeamId:     ptr.String("__TeamId__"),
						},
					},
				},
				PasswordPolicy: &types.UpdateBackendAuthPasswordPolicyConfig{
					AdditionalConstraints: []types.AdditionalConstraintsElement{
						types.AdditionalConstraintsElement("REQUIRE_DIGIT"),
						types.AdditionalConstraintsElement("REQUIRE_DIGIT"),
					},
					MinimumLength: ptr.Float64(1.0),
				},
				VerificationMessage: &types.UpdateBackendAuthVerificationMessageConfig{
					DeliveryMethod: types.DeliveryMethod("EMAIL"),
					EmailSettings: &types.EmailSettings{
						EmailMessage: ptr.String("__EmailMessage__"),
						EmailSubject: ptr.String("__EmailSubject__"),
					},
					SmsSettings: &types.SmsSettings{
						SmsMessage: ptr.String("__SmsMessage__"),
					},
				},
			},
		},
		ResourceName: ptr.String("__ResourceName__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.UpdateBackendAuth(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(), "UpdateBackendAuth"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_UpdateBackendConfig(t *testing.T) {
	input := &UpdateBackendConfigInput{
		AppId: ptr.String("__AppId__"),
		LoginAuthConfig: &types.LoginAuthConfigReqObj{
			AwsCognitoIdentityPoolId: ptr.String("__AwsCognitoIdentityPoolId__"),
			AwsCognitoRegion:         ptr.String("__AwsCognitoRegion__"),
			AwsUserPoolsId:           ptr.String("__AwsUserPoolsId__"),
			AwsUserPoolsWebClientId:  ptr.String("__AwsUserPoolsWebClientId__"),
		},
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.UpdateBackendConfig(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(), "UpdateBackendConfig"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_UpdateBackendJob(t *testing.T) {
	input := &UpdateBackendJobInput{
		AppId:                  ptr.String("__AppId__"),
		BackendEnvironmentName: ptr.String("__BackendEnvironmentName__"),
		JobId:                  ptr.String("__JobId__"),
		Operation:              ptr.String("__Operation__"),
		Status:                 ptr.String("__Status__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.UpdateBackendJob(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(), "UpdateBackendJob"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_UpdateBackendStorage(t *testing.T) {
	input := &UpdateBackendStorageInput{
		AppId:                  ptr.String("__AppId__"),
		BackendEnvironmentName: ptr.String("__BackendEnvironmentName__"),
		ResourceConfig: &types.UpdateBackendStorageResourceConfig{
			Permissions: &types.BackendStoragePermissions{
				Authenticated: []types.AuthenticatedElement{
					types.AuthenticatedElement("READ"),
					types.AuthenticatedElement("READ"),
				},
				UnAuthenticated: []types.UnAuthenticatedElement{
					types.UnAuthenticatedElement("READ"),
					types.UnAuthenticatedElement("READ"),
				},
			},
			ServiceName: types.ServiceName("S3"),
		},
		ResourceName: ptr.String("__ResourceName__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.UpdateBackendStorage(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(), "UpdateBackendStorage"); err != nil {
		t.Fatal(err)
	}
}
