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

//go:build request_snapshot

package arcregionswitch

import (
	"bytes"
	"context"
	"errors"
	"fmt"
	"github.com/aws/aws-sdk-go-v2/service/arcregionswitch/types"
	smithycbor "github.com/aws/smithy-go/encoding/cbor"
	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"
	"reflect"
	"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 {
	if len(got) == 0 || len(expected) == 0 {
		return bytes.Equal(got, expected)
	}
	gv, gerr := smithycbor.Decode(got)
	ev, eerr := smithycbor.Decode(expected)
	if gerr != nil || eerr != nil {
		return bytes.Equal(got, expected)
	}
	return reflect.DeepEqual(gv, ev)
}
func TestCheckRequestSnapshot_ApprovePlanExecutionStep(t *testing.T) {
	input := &ApprovePlanExecutionStepInput{
		PlanArn:     ptr.String("__PlanArn__"),
		ExecutionId: ptr.String("__ExecutionId__"),
		StepName:    ptr.String("__StepName__"),
		Approval:    types.Approval("approve"),
		Comment:     ptr.String("__Comment__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.ApprovePlanExecutionStep(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(), "ApprovePlanExecutionStep"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_CancelPlanExecution(t *testing.T) {
	input := &CancelPlanExecutionInput{
		PlanArn:     ptr.String("__PlanArn__"),
		ExecutionId: ptr.String("__ExecutionId__"),
		Comment:     ptr.String("__Comment__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.CancelPlanExecution(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(), "CancelPlanExecution"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_CreatePlan(t *testing.T) {
	input := &CreatePlanInput{
		Description: ptr.String("__Description__"),
		Workflows: []types.Workflow{
			{
				Steps: []types.Step{
					{
						Name:        ptr.String("__Name__"),
						Description: ptr.String("__Description__"),
						ExecutionBlockConfiguration: &types.ExecutionBlockConfigurationMemberCustomActionLambdaConfig{
							Value: types.CustomActionLambdaConfiguration{
								TimeoutMinutes: ptr.Int32(1),
								Lambdas: []types.Lambdas{
									{
										CrossAccountRole: ptr.String("__CrossAccountRole__"),
										ExternalId:       ptr.String("__ExternalId__"),
										Arn:              ptr.String("__Arn__"),
									},
									{
										CrossAccountRole: ptr.String("__CrossAccountRole__"),
										ExternalId:       ptr.String("__ExternalId__"),
										Arn:              ptr.String("__Arn__"),
									},
								},
								RetryIntervalMinutes: ptr.Float32(1.0),
								RegionToRun:          types.RegionToRunIn("activatingRegion"),
								Ungraceful: &types.LambdaUngraceful{
									Behavior: types.LambdaUngracefulBehavior("skip"),
								},
							},
						},
						ExecutionBlockType: types.ExecutionBlockType("CustomActionLambda"),
					},
					{
						Name:        ptr.String("__Name__"),
						Description: ptr.String("__Description__"),
						ExecutionBlockConfiguration: &types.ExecutionBlockConfigurationMemberCustomActionLambdaConfig{
							Value: types.CustomActionLambdaConfiguration{
								TimeoutMinutes: ptr.Int32(1),
								Lambdas: []types.Lambdas{
									{
										CrossAccountRole: ptr.String("__CrossAccountRole__"),
										ExternalId:       ptr.String("__ExternalId__"),
										Arn:              ptr.String("__Arn__"),
									},
									{
										CrossAccountRole: ptr.String("__CrossAccountRole__"),
										ExternalId:       ptr.String("__ExternalId__"),
										Arn:              ptr.String("__Arn__"),
									},
								},
								RetryIntervalMinutes: ptr.Float32(1.0),
								RegionToRun:          types.RegionToRunIn("activatingRegion"),
								Ungraceful: &types.LambdaUngraceful{
									Behavior: types.LambdaUngracefulBehavior("skip"),
								},
							},
						},
						ExecutionBlockType: types.ExecutionBlockType("CustomActionLambda"),
					},
				},
				WorkflowTargetAction: types.WorkflowTargetAction("activate"),
				WorkflowTargetRegion: ptr.String("__WorkflowTargetRegion__"),
				WorkflowDescription:  ptr.String("__WorkflowDescription__"),
			},
			{
				Steps: []types.Step{
					{
						Name:        ptr.String("__Name__"),
						Description: ptr.String("__Description__"),
						ExecutionBlockConfiguration: &types.ExecutionBlockConfigurationMemberCustomActionLambdaConfig{
							Value: types.CustomActionLambdaConfiguration{
								TimeoutMinutes: ptr.Int32(1),
								Lambdas: []types.Lambdas{
									{
										CrossAccountRole: ptr.String("__CrossAccountRole__"),
										ExternalId:       ptr.String("__ExternalId__"),
										Arn:              ptr.String("__Arn__"),
									},
									{
										CrossAccountRole: ptr.String("__CrossAccountRole__"),
										ExternalId:       ptr.String("__ExternalId__"),
										Arn:              ptr.String("__Arn__"),
									},
								},
								RetryIntervalMinutes: ptr.Float32(1.0),
								RegionToRun:          types.RegionToRunIn("activatingRegion"),
								Ungraceful: &types.LambdaUngraceful{
									Behavior: types.LambdaUngracefulBehavior("skip"),
								},
							},
						},
						ExecutionBlockType: types.ExecutionBlockType("CustomActionLambda"),
					},
					{
						Name:        ptr.String("__Name__"),
						Description: ptr.String("__Description__"),
						ExecutionBlockConfiguration: &types.ExecutionBlockConfigurationMemberCustomActionLambdaConfig{
							Value: types.CustomActionLambdaConfiguration{
								TimeoutMinutes: ptr.Int32(1),
								Lambdas: []types.Lambdas{
									{
										CrossAccountRole: ptr.String("__CrossAccountRole__"),
										ExternalId:       ptr.String("__ExternalId__"),
										Arn:              ptr.String("__Arn__"),
									},
									{
										CrossAccountRole: ptr.String("__CrossAccountRole__"),
										ExternalId:       ptr.String("__ExternalId__"),
										Arn:              ptr.String("__Arn__"),
									},
								},
								RetryIntervalMinutes: ptr.Float32(1.0),
								RegionToRun:          types.RegionToRunIn("activatingRegion"),
								Ungraceful: &types.LambdaUngraceful{
									Behavior: types.LambdaUngracefulBehavior("skip"),
								},
							},
						},
						ExecutionBlockType: types.ExecutionBlockType("CustomActionLambda"),
					},
				},
				WorkflowTargetAction: types.WorkflowTargetAction("activate"),
				WorkflowTargetRegion: ptr.String("__WorkflowTargetRegion__"),
				WorkflowDescription:  ptr.String("__WorkflowDescription__"),
			},
		},
		ExecutionRole:                ptr.String("__ExecutionRole__"),
		RecoveryTimeObjectiveMinutes: ptr.Int32(1),
		AssociatedAlarms: map[string]types.AssociatedAlarm{
			"key0": {
				CrossAccountRole:   ptr.String("__CrossAccountRole__"),
				ExternalId:         ptr.String("__ExternalId__"),
				ResourceIdentifier: ptr.String("__ResourceIdentifier__"),
				AlarmType:          types.AlarmType("applicationHealth"),
			},
		},
		Triggers: []types.Trigger{
			{
				Description:  ptr.String("__Description__"),
				TargetRegion: ptr.String("__TargetRegion__"),
				Action:       types.WorkflowTargetAction("activate"),
				Conditions: []types.TriggerCondition{
					{
						AssociatedAlarmName: ptr.String("__AssociatedAlarmName__"),
						Condition:           types.AlarmCondition("red"),
					},
					{
						AssociatedAlarmName: ptr.String("__AssociatedAlarmName__"),
						Condition:           types.AlarmCondition("red"),
					},
				},
				MinDelayMinutesBetweenExecutions: ptr.Int32(1),
			},
			{
				Description:  ptr.String("__Description__"),
				TargetRegion: ptr.String("__TargetRegion__"),
				Action:       types.WorkflowTargetAction("activate"),
				Conditions: []types.TriggerCondition{
					{
						AssociatedAlarmName: ptr.String("__AssociatedAlarmName__"),
						Condition:           types.AlarmCondition("red"),
					},
					{
						AssociatedAlarmName: ptr.String("__AssociatedAlarmName__"),
						Condition:           types.AlarmCondition("red"),
					},
				},
				MinDelayMinutesBetweenExecutions: ptr.Int32(1),
			},
		},
		ReportConfiguration: &types.ReportConfiguration{
			ReportOutput: []types.ReportOutputConfiguration{
				&types.ReportOutputConfigurationMemberS3Configuration{
					Value: types.S3ReportOutputConfiguration{
						BucketPath:  ptr.String("__BucketPath__"),
						BucketOwner: ptr.String("__BucketOwner__"),
					},
				},
				&types.ReportOutputConfigurationMemberS3Configuration{
					Value: types.S3ReportOutputConfiguration{
						BucketPath:  ptr.String("__BucketPath__"),
						BucketOwner: ptr.String("__BucketOwner__"),
					},
				},
			},
		},
		Name: ptr.String("__Name__"),
		Regions: []string{
			"__Member__",
			"__Member__",
		},
		RecoveryApproach: types.RecoveryApproach("activeActive"),
		PrimaryRegion:    ptr.String("__PrimaryRegion__"),
		Tags: map[string]string{
			"key0": "__Value__",
		},
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.CreatePlan(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(), "CreatePlan"); err != nil {
		t.Fatal(err)
	}
}

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

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

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

func TestCheckRequestSnapshot_GetPlanExecution(t *testing.T) {
	input := &GetPlanExecutionInput{
		PlanArn:     ptr.String("__PlanArn__"),
		ExecutionId: ptr.String("__ExecutionId__"),
		MaxResults:  ptr.Int32(1),
		NextToken:   ptr.String("__NextToken__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.GetPlanExecution(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(), "GetPlanExecution"); err != nil {
		t.Fatal(err)
	}
}

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

func TestCheckRequestSnapshot_ListPlanExecutionEvents(t *testing.T) {
	input := &ListPlanExecutionEventsInput{
		PlanArn:     ptr.String("__PlanArn__"),
		ExecutionId: ptr.String("__ExecutionId__"),
		MaxResults:  ptr.Int32(1),
		NextToken:   ptr.String("__NextToken__"),
		Name:        ptr.String("__Name__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.ListPlanExecutionEvents(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(), "ListPlanExecutionEvents"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_ListPlanExecutions(t *testing.T) {
	input := &ListPlanExecutionsInput{
		PlanArn:    ptr.String("__PlanArn__"),
		MaxResults: ptr.Int32(1),
		NextToken:  ptr.String("__NextToken__"),
		State:      types.ExecutionState("inProgress"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.ListPlanExecutions(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(), "ListPlanExecutions"); err != nil {
		t.Fatal(err)
	}
}

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

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

func TestCheckRequestSnapshot_ListRoute53HealthChecks(t *testing.T) {
	input := &ListRoute53HealthChecksInput{
		Arn:          ptr.String("__Arn__"),
		HostedZoneId: ptr.String("__HostedZoneId__"),
		RecordName:   ptr.String("__RecordName__"),
		MaxResults:   ptr.Int32(1),
		NextToken:    ptr.String("__NextToken__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.ListRoute53HealthChecks(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(), "ListRoute53HealthChecks"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_ListRoute53HealthChecksInRegion(t *testing.T) {
	input := &ListRoute53HealthChecksInRegionInput{
		Arn:          ptr.String("__Arn__"),
		HostedZoneId: ptr.String("__HostedZoneId__"),
		RecordName:   ptr.String("__RecordName__"),
		MaxResults:   ptr.Int32(1),
		NextToken:    ptr.String("__NextToken__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.ListRoute53HealthChecksInRegion(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(), "ListRoute53HealthChecksInRegion"); err != nil {
		t.Fatal(err)
	}
}

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

func TestCheckRequestSnapshot_StartPlanExecution(t *testing.T) {
	input := &StartPlanExecutionInput{
		PlanArn:             ptr.String("__PlanArn__"),
		TargetRegion:        ptr.String("__TargetRegion__"),
		Action:              types.ExecutionAction("activate"),
		Mode:                types.ExecutionMode("graceful"),
		Comment:             ptr.String("__Comment__"),
		LatestVersion:       ptr.String("__LatestVersion__"),
		RecoveryExecutionId: ptr.String("__RecoveryExecutionId__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.StartPlanExecution(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(), "StartPlanExecution"); err != nil {
		t.Fatal(err)
	}
}

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

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

func TestCheckRequestSnapshot_UpdatePlan(t *testing.T) {
	input := &UpdatePlanInput{
		Arn:         ptr.String("__Arn__"),
		Description: ptr.String("__Description__"),
		Workflows: []types.Workflow{
			{
				Steps: []types.Step{
					{
						Name:        ptr.String("__Name__"),
						Description: ptr.String("__Description__"),
						ExecutionBlockConfiguration: &types.ExecutionBlockConfigurationMemberCustomActionLambdaConfig{
							Value: types.CustomActionLambdaConfiguration{
								TimeoutMinutes: ptr.Int32(1),
								Lambdas: []types.Lambdas{
									{
										CrossAccountRole: ptr.String("__CrossAccountRole__"),
										ExternalId:       ptr.String("__ExternalId__"),
										Arn:              ptr.String("__Arn__"),
									},
									{
										CrossAccountRole: ptr.String("__CrossAccountRole__"),
										ExternalId:       ptr.String("__ExternalId__"),
										Arn:              ptr.String("__Arn__"),
									},
								},
								RetryIntervalMinutes: ptr.Float32(1.0),
								RegionToRun:          types.RegionToRunIn("activatingRegion"),
								Ungraceful: &types.LambdaUngraceful{
									Behavior: types.LambdaUngracefulBehavior("skip"),
								},
							},
						},
						ExecutionBlockType: types.ExecutionBlockType("CustomActionLambda"),
					},
					{
						Name:        ptr.String("__Name__"),
						Description: ptr.String("__Description__"),
						ExecutionBlockConfiguration: &types.ExecutionBlockConfigurationMemberCustomActionLambdaConfig{
							Value: types.CustomActionLambdaConfiguration{
								TimeoutMinutes: ptr.Int32(1),
								Lambdas: []types.Lambdas{
									{
										CrossAccountRole: ptr.String("__CrossAccountRole__"),
										ExternalId:       ptr.String("__ExternalId__"),
										Arn:              ptr.String("__Arn__"),
									},
									{
										CrossAccountRole: ptr.String("__CrossAccountRole__"),
										ExternalId:       ptr.String("__ExternalId__"),
										Arn:              ptr.String("__Arn__"),
									},
								},
								RetryIntervalMinutes: ptr.Float32(1.0),
								RegionToRun:          types.RegionToRunIn("activatingRegion"),
								Ungraceful: &types.LambdaUngraceful{
									Behavior: types.LambdaUngracefulBehavior("skip"),
								},
							},
						},
						ExecutionBlockType: types.ExecutionBlockType("CustomActionLambda"),
					},
				},
				WorkflowTargetAction: types.WorkflowTargetAction("activate"),
				WorkflowTargetRegion: ptr.String("__WorkflowTargetRegion__"),
				WorkflowDescription:  ptr.String("__WorkflowDescription__"),
			},
			{
				Steps: []types.Step{
					{
						Name:        ptr.String("__Name__"),
						Description: ptr.String("__Description__"),
						ExecutionBlockConfiguration: &types.ExecutionBlockConfigurationMemberCustomActionLambdaConfig{
							Value: types.CustomActionLambdaConfiguration{
								TimeoutMinutes: ptr.Int32(1),
								Lambdas: []types.Lambdas{
									{
										CrossAccountRole: ptr.String("__CrossAccountRole__"),
										ExternalId:       ptr.String("__ExternalId__"),
										Arn:              ptr.String("__Arn__"),
									},
									{
										CrossAccountRole: ptr.String("__CrossAccountRole__"),
										ExternalId:       ptr.String("__ExternalId__"),
										Arn:              ptr.String("__Arn__"),
									},
								},
								RetryIntervalMinutes: ptr.Float32(1.0),
								RegionToRun:          types.RegionToRunIn("activatingRegion"),
								Ungraceful: &types.LambdaUngraceful{
									Behavior: types.LambdaUngracefulBehavior("skip"),
								},
							},
						},
						ExecutionBlockType: types.ExecutionBlockType("CustomActionLambda"),
					},
					{
						Name:        ptr.String("__Name__"),
						Description: ptr.String("__Description__"),
						ExecutionBlockConfiguration: &types.ExecutionBlockConfigurationMemberCustomActionLambdaConfig{
							Value: types.CustomActionLambdaConfiguration{
								TimeoutMinutes: ptr.Int32(1),
								Lambdas: []types.Lambdas{
									{
										CrossAccountRole: ptr.String("__CrossAccountRole__"),
										ExternalId:       ptr.String("__ExternalId__"),
										Arn:              ptr.String("__Arn__"),
									},
									{
										CrossAccountRole: ptr.String("__CrossAccountRole__"),
										ExternalId:       ptr.String("__ExternalId__"),
										Arn:              ptr.String("__Arn__"),
									},
								},
								RetryIntervalMinutes: ptr.Float32(1.0),
								RegionToRun:          types.RegionToRunIn("activatingRegion"),
								Ungraceful: &types.LambdaUngraceful{
									Behavior: types.LambdaUngracefulBehavior("skip"),
								},
							},
						},
						ExecutionBlockType: types.ExecutionBlockType("CustomActionLambda"),
					},
				},
				WorkflowTargetAction: types.WorkflowTargetAction("activate"),
				WorkflowTargetRegion: ptr.String("__WorkflowTargetRegion__"),
				WorkflowDescription:  ptr.String("__WorkflowDescription__"),
			},
		},
		ExecutionRole:                ptr.String("__ExecutionRole__"),
		RecoveryTimeObjectiveMinutes: ptr.Int32(1),
		AssociatedAlarms: map[string]types.AssociatedAlarm{
			"key0": {
				CrossAccountRole:   ptr.String("__CrossAccountRole__"),
				ExternalId:         ptr.String("__ExternalId__"),
				ResourceIdentifier: ptr.String("__ResourceIdentifier__"),
				AlarmType:          types.AlarmType("applicationHealth"),
			},
		},
		Triggers: []types.Trigger{
			{
				Description:  ptr.String("__Description__"),
				TargetRegion: ptr.String("__TargetRegion__"),
				Action:       types.WorkflowTargetAction("activate"),
				Conditions: []types.TriggerCondition{
					{
						AssociatedAlarmName: ptr.String("__AssociatedAlarmName__"),
						Condition:           types.AlarmCondition("red"),
					},
					{
						AssociatedAlarmName: ptr.String("__AssociatedAlarmName__"),
						Condition:           types.AlarmCondition("red"),
					},
				},
				MinDelayMinutesBetweenExecutions: ptr.Int32(1),
			},
			{
				Description:  ptr.String("__Description__"),
				TargetRegion: ptr.String("__TargetRegion__"),
				Action:       types.WorkflowTargetAction("activate"),
				Conditions: []types.TriggerCondition{
					{
						AssociatedAlarmName: ptr.String("__AssociatedAlarmName__"),
						Condition:           types.AlarmCondition("red"),
					},
					{
						AssociatedAlarmName: ptr.String("__AssociatedAlarmName__"),
						Condition:           types.AlarmCondition("red"),
					},
				},
				MinDelayMinutesBetweenExecutions: ptr.Int32(1),
			},
		},
		ReportConfiguration: &types.ReportConfiguration{
			ReportOutput: []types.ReportOutputConfiguration{
				&types.ReportOutputConfigurationMemberS3Configuration{
					Value: types.S3ReportOutputConfiguration{
						BucketPath:  ptr.String("__BucketPath__"),
						BucketOwner: ptr.String("__BucketOwner__"),
					},
				},
				&types.ReportOutputConfigurationMemberS3Configuration{
					Value: types.S3ReportOutputConfiguration{
						BucketPath:  ptr.String("__BucketPath__"),
						BucketOwner: ptr.String("__BucketOwner__"),
					},
				},
			},
		},
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.UpdatePlan(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(), "UpdatePlan"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_UpdatePlanExecution(t *testing.T) {
	input := &UpdatePlanExecutionInput{
		PlanArn:     ptr.String("__PlanArn__"),
		ExecutionId: ptr.String("__ExecutionId__"),
		Action:      types.UpdatePlanExecutionAction("switchToGraceful"),
		Comment:     ptr.String("__Comment__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.UpdatePlanExecution(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(), "UpdatePlanExecution"); err != nil {
		t.Fatal(err)
	}
}

func TestCheckRequestSnapshot_UpdatePlanExecutionStep(t *testing.T) {
	input := &UpdatePlanExecutionStepInput{
		PlanArn:      ptr.String("__PlanArn__"),
		ExecutionId:  ptr.String("__ExecutionId__"),
		Comment:      ptr.String("__Comment__"),
		StepName:     ptr.String("__StepName__"),
		ActionToTake: types.UpdatePlanExecutionStepAction("switchToUngraceful"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.UpdatePlanExecutionStep(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(), "UpdatePlanExecutionStep"); err != nil {
		t.Fatal(err)
	}
}
func TestUpdateRequestSnapshot_ApprovePlanExecutionStep(t *testing.T) {
	input := &ApprovePlanExecutionStepInput{
		PlanArn:     ptr.String("__PlanArn__"),
		ExecutionId: ptr.String("__ExecutionId__"),
		StepName:    ptr.String("__StepName__"),
		Approval:    types.Approval("approve"),
		Comment:     ptr.String("__Comment__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.ApprovePlanExecutionStep(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(), "ApprovePlanExecutionStep"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_CancelPlanExecution(t *testing.T) {
	input := &CancelPlanExecutionInput{
		PlanArn:     ptr.String("__PlanArn__"),
		ExecutionId: ptr.String("__ExecutionId__"),
		Comment:     ptr.String("__Comment__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.CancelPlanExecution(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(), "CancelPlanExecution"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_CreatePlan(t *testing.T) {
	input := &CreatePlanInput{
		Description: ptr.String("__Description__"),
		Workflows: []types.Workflow{
			{
				Steps: []types.Step{
					{
						Name:        ptr.String("__Name__"),
						Description: ptr.String("__Description__"),
						ExecutionBlockConfiguration: &types.ExecutionBlockConfigurationMemberCustomActionLambdaConfig{
							Value: types.CustomActionLambdaConfiguration{
								TimeoutMinutes: ptr.Int32(1),
								Lambdas: []types.Lambdas{
									{
										CrossAccountRole: ptr.String("__CrossAccountRole__"),
										ExternalId:       ptr.String("__ExternalId__"),
										Arn:              ptr.String("__Arn__"),
									},
									{
										CrossAccountRole: ptr.String("__CrossAccountRole__"),
										ExternalId:       ptr.String("__ExternalId__"),
										Arn:              ptr.String("__Arn__"),
									},
								},
								RetryIntervalMinutes: ptr.Float32(1.0),
								RegionToRun:          types.RegionToRunIn("activatingRegion"),
								Ungraceful: &types.LambdaUngraceful{
									Behavior: types.LambdaUngracefulBehavior("skip"),
								},
							},
						},
						ExecutionBlockType: types.ExecutionBlockType("CustomActionLambda"),
					},
					{
						Name:        ptr.String("__Name__"),
						Description: ptr.String("__Description__"),
						ExecutionBlockConfiguration: &types.ExecutionBlockConfigurationMemberCustomActionLambdaConfig{
							Value: types.CustomActionLambdaConfiguration{
								TimeoutMinutes: ptr.Int32(1),
								Lambdas: []types.Lambdas{
									{
										CrossAccountRole: ptr.String("__CrossAccountRole__"),
										ExternalId:       ptr.String("__ExternalId__"),
										Arn:              ptr.String("__Arn__"),
									},
									{
										CrossAccountRole: ptr.String("__CrossAccountRole__"),
										ExternalId:       ptr.String("__ExternalId__"),
										Arn:              ptr.String("__Arn__"),
									},
								},
								RetryIntervalMinutes: ptr.Float32(1.0),
								RegionToRun:          types.RegionToRunIn("activatingRegion"),
								Ungraceful: &types.LambdaUngraceful{
									Behavior: types.LambdaUngracefulBehavior("skip"),
								},
							},
						},
						ExecutionBlockType: types.ExecutionBlockType("CustomActionLambda"),
					},
				},
				WorkflowTargetAction: types.WorkflowTargetAction("activate"),
				WorkflowTargetRegion: ptr.String("__WorkflowTargetRegion__"),
				WorkflowDescription:  ptr.String("__WorkflowDescription__"),
			},
			{
				Steps: []types.Step{
					{
						Name:        ptr.String("__Name__"),
						Description: ptr.String("__Description__"),
						ExecutionBlockConfiguration: &types.ExecutionBlockConfigurationMemberCustomActionLambdaConfig{
							Value: types.CustomActionLambdaConfiguration{
								TimeoutMinutes: ptr.Int32(1),
								Lambdas: []types.Lambdas{
									{
										CrossAccountRole: ptr.String("__CrossAccountRole__"),
										ExternalId:       ptr.String("__ExternalId__"),
										Arn:              ptr.String("__Arn__"),
									},
									{
										CrossAccountRole: ptr.String("__CrossAccountRole__"),
										ExternalId:       ptr.String("__ExternalId__"),
										Arn:              ptr.String("__Arn__"),
									},
								},
								RetryIntervalMinutes: ptr.Float32(1.0),
								RegionToRun:          types.RegionToRunIn("activatingRegion"),
								Ungraceful: &types.LambdaUngraceful{
									Behavior: types.LambdaUngracefulBehavior("skip"),
								},
							},
						},
						ExecutionBlockType: types.ExecutionBlockType("CustomActionLambda"),
					},
					{
						Name:        ptr.String("__Name__"),
						Description: ptr.String("__Description__"),
						ExecutionBlockConfiguration: &types.ExecutionBlockConfigurationMemberCustomActionLambdaConfig{
							Value: types.CustomActionLambdaConfiguration{
								TimeoutMinutes: ptr.Int32(1),
								Lambdas: []types.Lambdas{
									{
										CrossAccountRole: ptr.String("__CrossAccountRole__"),
										ExternalId:       ptr.String("__ExternalId__"),
										Arn:              ptr.String("__Arn__"),
									},
									{
										CrossAccountRole: ptr.String("__CrossAccountRole__"),
										ExternalId:       ptr.String("__ExternalId__"),
										Arn:              ptr.String("__Arn__"),
									},
								},
								RetryIntervalMinutes: ptr.Float32(1.0),
								RegionToRun:          types.RegionToRunIn("activatingRegion"),
								Ungraceful: &types.LambdaUngraceful{
									Behavior: types.LambdaUngracefulBehavior("skip"),
								},
							},
						},
						ExecutionBlockType: types.ExecutionBlockType("CustomActionLambda"),
					},
				},
				WorkflowTargetAction: types.WorkflowTargetAction("activate"),
				WorkflowTargetRegion: ptr.String("__WorkflowTargetRegion__"),
				WorkflowDescription:  ptr.String("__WorkflowDescription__"),
			},
		},
		ExecutionRole:                ptr.String("__ExecutionRole__"),
		RecoveryTimeObjectiveMinutes: ptr.Int32(1),
		AssociatedAlarms: map[string]types.AssociatedAlarm{
			"key0": {
				CrossAccountRole:   ptr.String("__CrossAccountRole__"),
				ExternalId:         ptr.String("__ExternalId__"),
				ResourceIdentifier: ptr.String("__ResourceIdentifier__"),
				AlarmType:          types.AlarmType("applicationHealth"),
			},
		},
		Triggers: []types.Trigger{
			{
				Description:  ptr.String("__Description__"),
				TargetRegion: ptr.String("__TargetRegion__"),
				Action:       types.WorkflowTargetAction("activate"),
				Conditions: []types.TriggerCondition{
					{
						AssociatedAlarmName: ptr.String("__AssociatedAlarmName__"),
						Condition:           types.AlarmCondition("red"),
					},
					{
						AssociatedAlarmName: ptr.String("__AssociatedAlarmName__"),
						Condition:           types.AlarmCondition("red"),
					},
				},
				MinDelayMinutesBetweenExecutions: ptr.Int32(1),
			},
			{
				Description:  ptr.String("__Description__"),
				TargetRegion: ptr.String("__TargetRegion__"),
				Action:       types.WorkflowTargetAction("activate"),
				Conditions: []types.TriggerCondition{
					{
						AssociatedAlarmName: ptr.String("__AssociatedAlarmName__"),
						Condition:           types.AlarmCondition("red"),
					},
					{
						AssociatedAlarmName: ptr.String("__AssociatedAlarmName__"),
						Condition:           types.AlarmCondition("red"),
					},
				},
				MinDelayMinutesBetweenExecutions: ptr.Int32(1),
			},
		},
		ReportConfiguration: &types.ReportConfiguration{
			ReportOutput: []types.ReportOutputConfiguration{
				&types.ReportOutputConfigurationMemberS3Configuration{
					Value: types.S3ReportOutputConfiguration{
						BucketPath:  ptr.String("__BucketPath__"),
						BucketOwner: ptr.String("__BucketOwner__"),
					},
				},
				&types.ReportOutputConfigurationMemberS3Configuration{
					Value: types.S3ReportOutputConfiguration{
						BucketPath:  ptr.String("__BucketPath__"),
						BucketOwner: ptr.String("__BucketOwner__"),
					},
				},
			},
		},
		Name: ptr.String("__Name__"),
		Regions: []string{
			"__Member__",
			"__Member__",
		},
		RecoveryApproach: types.RecoveryApproach("activeActive"),
		PrimaryRegion:    ptr.String("__PrimaryRegion__"),
		Tags: map[string]string{
			"key0": "__Value__",
		},
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.CreatePlan(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(), "CreatePlan"); err != nil {
		t.Fatal(err)
	}
}

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

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

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

func TestUpdateRequestSnapshot_GetPlanExecution(t *testing.T) {
	input := &GetPlanExecutionInput{
		PlanArn:     ptr.String("__PlanArn__"),
		ExecutionId: ptr.String("__ExecutionId__"),
		MaxResults:  ptr.Int32(1),
		NextToken:   ptr.String("__NextToken__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.GetPlanExecution(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(), "GetPlanExecution"); err != nil {
		t.Fatal(err)
	}
}

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

func TestUpdateRequestSnapshot_ListPlanExecutionEvents(t *testing.T) {
	input := &ListPlanExecutionEventsInput{
		PlanArn:     ptr.String("__PlanArn__"),
		ExecutionId: ptr.String("__ExecutionId__"),
		MaxResults:  ptr.Int32(1),
		NextToken:   ptr.String("__NextToken__"),
		Name:        ptr.String("__Name__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.ListPlanExecutionEvents(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(), "ListPlanExecutionEvents"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_ListPlanExecutions(t *testing.T) {
	input := &ListPlanExecutionsInput{
		PlanArn:    ptr.String("__PlanArn__"),
		MaxResults: ptr.Int32(1),
		NextToken:  ptr.String("__NextToken__"),
		State:      types.ExecutionState("inProgress"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.ListPlanExecutions(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(), "ListPlanExecutions"); err != nil {
		t.Fatal(err)
	}
}

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

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

func TestUpdateRequestSnapshot_ListRoute53HealthChecks(t *testing.T) {
	input := &ListRoute53HealthChecksInput{
		Arn:          ptr.String("__Arn__"),
		HostedZoneId: ptr.String("__HostedZoneId__"),
		RecordName:   ptr.String("__RecordName__"),
		MaxResults:   ptr.Int32(1),
		NextToken:    ptr.String("__NextToken__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.ListRoute53HealthChecks(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(), "ListRoute53HealthChecks"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_ListRoute53HealthChecksInRegion(t *testing.T) {
	input := &ListRoute53HealthChecksInRegionInput{
		Arn:          ptr.String("__Arn__"),
		HostedZoneId: ptr.String("__HostedZoneId__"),
		RecordName:   ptr.String("__RecordName__"),
		MaxResults:   ptr.Int32(1),
		NextToken:    ptr.String("__NextToken__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.ListRoute53HealthChecksInRegion(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(), "ListRoute53HealthChecksInRegion"); err != nil {
		t.Fatal(err)
	}
}

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

func TestUpdateRequestSnapshot_StartPlanExecution(t *testing.T) {
	input := &StartPlanExecutionInput{
		PlanArn:             ptr.String("__PlanArn__"),
		TargetRegion:        ptr.String("__TargetRegion__"),
		Action:              types.ExecutionAction("activate"),
		Mode:                types.ExecutionMode("graceful"),
		Comment:             ptr.String("__Comment__"),
		LatestVersion:       ptr.String("__LatestVersion__"),
		RecoveryExecutionId: ptr.String("__RecoveryExecutionId__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.StartPlanExecution(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(), "StartPlanExecution"); err != nil {
		t.Fatal(err)
	}
}

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

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

func TestUpdateRequestSnapshot_UpdatePlan(t *testing.T) {
	input := &UpdatePlanInput{
		Arn:         ptr.String("__Arn__"),
		Description: ptr.String("__Description__"),
		Workflows: []types.Workflow{
			{
				Steps: []types.Step{
					{
						Name:        ptr.String("__Name__"),
						Description: ptr.String("__Description__"),
						ExecutionBlockConfiguration: &types.ExecutionBlockConfigurationMemberCustomActionLambdaConfig{
							Value: types.CustomActionLambdaConfiguration{
								TimeoutMinutes: ptr.Int32(1),
								Lambdas: []types.Lambdas{
									{
										CrossAccountRole: ptr.String("__CrossAccountRole__"),
										ExternalId:       ptr.String("__ExternalId__"),
										Arn:              ptr.String("__Arn__"),
									},
									{
										CrossAccountRole: ptr.String("__CrossAccountRole__"),
										ExternalId:       ptr.String("__ExternalId__"),
										Arn:              ptr.String("__Arn__"),
									},
								},
								RetryIntervalMinutes: ptr.Float32(1.0),
								RegionToRun:          types.RegionToRunIn("activatingRegion"),
								Ungraceful: &types.LambdaUngraceful{
									Behavior: types.LambdaUngracefulBehavior("skip"),
								},
							},
						},
						ExecutionBlockType: types.ExecutionBlockType("CustomActionLambda"),
					},
					{
						Name:        ptr.String("__Name__"),
						Description: ptr.String("__Description__"),
						ExecutionBlockConfiguration: &types.ExecutionBlockConfigurationMemberCustomActionLambdaConfig{
							Value: types.CustomActionLambdaConfiguration{
								TimeoutMinutes: ptr.Int32(1),
								Lambdas: []types.Lambdas{
									{
										CrossAccountRole: ptr.String("__CrossAccountRole__"),
										ExternalId:       ptr.String("__ExternalId__"),
										Arn:              ptr.String("__Arn__"),
									},
									{
										CrossAccountRole: ptr.String("__CrossAccountRole__"),
										ExternalId:       ptr.String("__ExternalId__"),
										Arn:              ptr.String("__Arn__"),
									},
								},
								RetryIntervalMinutes: ptr.Float32(1.0),
								RegionToRun:          types.RegionToRunIn("activatingRegion"),
								Ungraceful: &types.LambdaUngraceful{
									Behavior: types.LambdaUngracefulBehavior("skip"),
								},
							},
						},
						ExecutionBlockType: types.ExecutionBlockType("CustomActionLambda"),
					},
				},
				WorkflowTargetAction: types.WorkflowTargetAction("activate"),
				WorkflowTargetRegion: ptr.String("__WorkflowTargetRegion__"),
				WorkflowDescription:  ptr.String("__WorkflowDescription__"),
			},
			{
				Steps: []types.Step{
					{
						Name:        ptr.String("__Name__"),
						Description: ptr.String("__Description__"),
						ExecutionBlockConfiguration: &types.ExecutionBlockConfigurationMemberCustomActionLambdaConfig{
							Value: types.CustomActionLambdaConfiguration{
								TimeoutMinutes: ptr.Int32(1),
								Lambdas: []types.Lambdas{
									{
										CrossAccountRole: ptr.String("__CrossAccountRole__"),
										ExternalId:       ptr.String("__ExternalId__"),
										Arn:              ptr.String("__Arn__"),
									},
									{
										CrossAccountRole: ptr.String("__CrossAccountRole__"),
										ExternalId:       ptr.String("__ExternalId__"),
										Arn:              ptr.String("__Arn__"),
									},
								},
								RetryIntervalMinutes: ptr.Float32(1.0),
								RegionToRun:          types.RegionToRunIn("activatingRegion"),
								Ungraceful: &types.LambdaUngraceful{
									Behavior: types.LambdaUngracefulBehavior("skip"),
								},
							},
						},
						ExecutionBlockType: types.ExecutionBlockType("CustomActionLambda"),
					},
					{
						Name:        ptr.String("__Name__"),
						Description: ptr.String("__Description__"),
						ExecutionBlockConfiguration: &types.ExecutionBlockConfigurationMemberCustomActionLambdaConfig{
							Value: types.CustomActionLambdaConfiguration{
								TimeoutMinutes: ptr.Int32(1),
								Lambdas: []types.Lambdas{
									{
										CrossAccountRole: ptr.String("__CrossAccountRole__"),
										ExternalId:       ptr.String("__ExternalId__"),
										Arn:              ptr.String("__Arn__"),
									},
									{
										CrossAccountRole: ptr.String("__CrossAccountRole__"),
										ExternalId:       ptr.String("__ExternalId__"),
										Arn:              ptr.String("__Arn__"),
									},
								},
								RetryIntervalMinutes: ptr.Float32(1.0),
								RegionToRun:          types.RegionToRunIn("activatingRegion"),
								Ungraceful: &types.LambdaUngraceful{
									Behavior: types.LambdaUngracefulBehavior("skip"),
								},
							},
						},
						ExecutionBlockType: types.ExecutionBlockType("CustomActionLambda"),
					},
				},
				WorkflowTargetAction: types.WorkflowTargetAction("activate"),
				WorkflowTargetRegion: ptr.String("__WorkflowTargetRegion__"),
				WorkflowDescription:  ptr.String("__WorkflowDescription__"),
			},
		},
		ExecutionRole:                ptr.String("__ExecutionRole__"),
		RecoveryTimeObjectiveMinutes: ptr.Int32(1),
		AssociatedAlarms: map[string]types.AssociatedAlarm{
			"key0": {
				CrossAccountRole:   ptr.String("__CrossAccountRole__"),
				ExternalId:         ptr.String("__ExternalId__"),
				ResourceIdentifier: ptr.String("__ResourceIdentifier__"),
				AlarmType:          types.AlarmType("applicationHealth"),
			},
		},
		Triggers: []types.Trigger{
			{
				Description:  ptr.String("__Description__"),
				TargetRegion: ptr.String("__TargetRegion__"),
				Action:       types.WorkflowTargetAction("activate"),
				Conditions: []types.TriggerCondition{
					{
						AssociatedAlarmName: ptr.String("__AssociatedAlarmName__"),
						Condition:           types.AlarmCondition("red"),
					},
					{
						AssociatedAlarmName: ptr.String("__AssociatedAlarmName__"),
						Condition:           types.AlarmCondition("red"),
					},
				},
				MinDelayMinutesBetweenExecutions: ptr.Int32(1),
			},
			{
				Description:  ptr.String("__Description__"),
				TargetRegion: ptr.String("__TargetRegion__"),
				Action:       types.WorkflowTargetAction("activate"),
				Conditions: []types.TriggerCondition{
					{
						AssociatedAlarmName: ptr.String("__AssociatedAlarmName__"),
						Condition:           types.AlarmCondition("red"),
					},
					{
						AssociatedAlarmName: ptr.String("__AssociatedAlarmName__"),
						Condition:           types.AlarmCondition("red"),
					},
				},
				MinDelayMinutesBetweenExecutions: ptr.Int32(1),
			},
		},
		ReportConfiguration: &types.ReportConfiguration{
			ReportOutput: []types.ReportOutputConfiguration{
				&types.ReportOutputConfigurationMemberS3Configuration{
					Value: types.S3ReportOutputConfiguration{
						BucketPath:  ptr.String("__BucketPath__"),
						BucketOwner: ptr.String("__BucketOwner__"),
					},
				},
				&types.ReportOutputConfigurationMemberS3Configuration{
					Value: types.S3ReportOutputConfiguration{
						BucketPath:  ptr.String("__BucketPath__"),
						BucketOwner: ptr.String("__BucketOwner__"),
					},
				},
			},
		},
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.UpdatePlan(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(), "UpdatePlan"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_UpdatePlanExecution(t *testing.T) {
	input := &UpdatePlanExecutionInput{
		PlanArn:     ptr.String("__PlanArn__"),
		ExecutionId: ptr.String("__ExecutionId__"),
		Action:      types.UpdatePlanExecutionAction("switchToGraceful"),
		Comment:     ptr.String("__Comment__"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.UpdatePlanExecution(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(), "UpdatePlanExecution"); err != nil {
		t.Fatal(err)
	}
}

func TestUpdateRequestSnapshot_UpdatePlanExecutionStep(t *testing.T) {
	input := &UpdatePlanExecutionStepInput{
		PlanArn:      ptr.String("__PlanArn__"),
		ExecutionId:  ptr.String("__ExecutionId__"),
		Comment:      ptr.String("__Comment__"),
		StepName:     ptr.String("__StepName__"),
		ActionToTake: types.UpdatePlanExecutionStepAction("switchToUngraceful"),
	}
	body := &bytes.Buffer{}
	method := ""
	rawPath := ""
	rawQuery := ""
	header := map[string][]string{}
	svc := serdeNewClient()
	_, err := svc.UpdatePlanExecutionStep(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(), "UpdatePlanExecutionStep"); err != nil {
		t.Fatal(err)
	}
}
